Working with objects - Component overview - Query - Aggregate functions.php 274 Bytes
Newer Older
1

hansbrix's avatar
hansbrix committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
<code type="php">
$q = new Doctrine_Query();

$q->from('User(COUNT(id))');

// returns an array
$a = $q->execute();

// selecting multiple aggregate values:
$q = new Doctrine_Query();

$q->from('User(COUNT(id)).Phonenumber(MAX(phonenumber))');

$a = $q->execute();
</code>