Added simple COUNT() example
This commit is contained in:
parent
e7e005308d
commit
4fc97fe1b8
@ -1,3 +1,9 @@
|
||||
<?php
|
||||
echo 'test';
|
||||
// SELECT u.*, COUNT(p.id) num_posts FROM User u, u.Posts p WHERE u.id = 1
|
||||
|
||||
$query = new Doctrine_Query();
|
||||
|
||||
$query->select('u.*, COUNT(p.id) num_posts')
|
||||
->from('User u, u.Posts p')
|
||||
->where('u.id = ?', 1)
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user