Subqueries with Doctrine_RawSql

leahred

New Member
Is it possible to have subqueries in the select field of Doctrine_RawSql?\[code\]$q->select('{t.*}, {i.*}, {e.*}, {f.*}, {f2.*}');$q->addSelect("(SELECT f.id FROM Following f WHERE f.follower_id = ? AND f.following_id = t.owner_id) AS following");$q->addSelect("(SELECT COUNT(c.id) FROM PostComments c WHERE c.post_id = t.id) AS num_comments");\[/code\]The above example is what I have tired, but it pretty much breaks the query (it will not select anything other than the primary keys on each row). Is there a special way to do this or am I just out of luck?
 
Back
Top