我是mysql初学者 谁能帮我解决第 5 行的错误:
select a.*, count(b.user_id) as attempts from survey a
left join survey_attempt b on a.survey_id = b.attempt_surveyid
where a.survey_status != 0
order by survey_order asc
GROUP by a.survey_id
最佳答案
您的 ORDER BY 应该在 GROUP BY 之后。
关于mysql - ORDER BY 和 GROUP BY 的正确顺序是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35956420/