Я пытаюсь написать этот MySQL запрос
http://sqlfiddle.com/#! 9 / e417f3 / 2
SELECT user.name as user, offer.score, course.name as course, city.name as city
FROM offer
INNER JOIN course ON course.id = offer.course_id
INNER JOIN user ON user.id = offer.user_id
INNER JOIN city ON city.id = user.city_id
GROUP BY offer.course_id
ORDER BY offer.score DESC;
in Doctrine
return $this
->createQueryBuilder('offer')
->select('offer.id')
->innerJoin('offer.course', 'course')
->innerJoin('offer.tutor', 'user')
->innerJoin('user.city', 'city')
->groupBy('offer.course')
->orderBy('offer.score', 'DESC')
->getQuery();
И вернуть эту ошибку:
SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column
Может помочь мне решить ее?