我收到以下错误:
[语义错误] line 0, col 15 near 'question_id)': Error: Class Acme\MyBundle\Entity\SurveysQuestions 没有名为 question_id 的字段或关联
我正在查看PhpMyAdmin 中的 SurveysQuestions,是的,它有一个 question_id 字段:
survey_id question_id score
7 1 3.5
7 2 4
etc.
查询是:
'SELECT COUNT(sq.question_id) AS votes, sq.score AS score, q.question FROM MyBundle:SurveysQuestions sq LEFT OUTER JOIN sq.question q WHERE q.id = :id AND q.deletedAt IS NULL GROUP BY q.id, sq.score ORDER BY sq.score DESC'
不知道我做错了什么......