我有以下 Doctrine2 查询:
$qb = $em->createQueryBuilder()
->select('t.tag_text, COUNT(*) as num_tags')
->from('CompanyWebsiteBundle:Tag2Post', 't2p')
->innerJoin('t2p.tags', 't')
->groupBy('t.tag_text')
;
$tags = $qb->getQuery()->getResult();
运行时出现以下错误:
[Semantical Error] line 0, col 21 near '*) as num_tags': Error: '*' is not defined.
我将如何在 Doctrine2 中执行 MySQL 计数(*)?