PEAR Manual
Prev |  | Next

# ->groupBy()

->groupBy() -- Add group by condition

## Synopsis

``void $DB_DataObject->groupBy` ([string $group])`

## Description

Adds a group by condition. Calling this without any arguments clears the Group Condition

## Parameter

- `string $group` - Grouping condition

## Note

This function can not be called statically.

## Example

Example 33-1. Setting the Group by
    $person = new DataObjects_Person;
    $person->groupBy('name');
    $person->groupBy('age, eye');
    $person->find();

Example 33-2. Resulting SQL
    SELECT * FROM person GROUP BY name, age, eye

Prev | Home | Next
->orderBy() | Up | Automatic Table Linking and Joins