【发布时间】:2014-04-07 12:34:11
【问题描述】:
我有这个问题:
$qb = $this->_em->createQueryBuilder();
$qb->select('DISTINCT c.account')
->from('ThanksWhoProjectBundle:Comment', 'c')
->leftjoin('c.account', 'a')
->where('c.conversation = ?1')
->setParameters(array(1 => $conversation));
return $qb->getQuery()->getResult();
所以,Comment.account 字段是我的实体 Account 的外键。我只需要检索对话中的所有不同帐户。
所以,我只想选择字段c.account,但是这个查询有这个错误:
[Semantical Error] line 0, col 18 near 'account FROM': Error: Invalid PathExpression. Must be a StateFieldPathExpression. (500 Internal Server Error)
我该怎么做?
【问题讨论】:
标签: php mysql sql symfony doctrine-orm