Changeset 4312
- Timestamp:
- 04/30/08 18:00:25 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/0.11/manual/docs/en/dql-doctrine-query-language/select-queries.txt
r4311 r4312 81 81 $query = Doctrine_Query::create(); 82 82 83 $query->select('u. *, COUNT(p.id) num_posts')83 $query->select('u.id, COUNT(p.id) num_posts') 84 84 ->from('User u, u.Posts p') 85 85 ->where('u.id = ?', 1) … … 90 90 echo $users->Posts[0]->num_posts . ' posts found'; 91 91 </code> 92 93 This above example works only in mysql. In pgsql it is required that you group by all the columns being selected94 when using aggregate functions in the select.