gpt4 book ai didi

mysql - ORDER BY 和 GROUP BY 的正确顺序是什么

转载 作者:行者123 更新时间:2023-12-01 00:09:22 24 4
gpt4 key购买 nike

我是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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com