I need your help, please. I have this SQL query:
SELECT * , COUNT( * ) AS count FROM mytable GROUP BY email ORDER BY id DESC LIMIT 0 , 30
But I would like to do this in Symfony2 with Doctrine and createQueryBuilder (). I tried this but did not work:
$db = $this->createQueryBuilder('s'); $db->andWhere('COUNT( * ) AS count'); $db->groupBy('s.email'); $db->orderBy('s.id', 'DESC');
Can you help me? Thanks:)
source share