gpt4 book ai didi

MySQL 排序列表问题

转载 作者:行者123 更新时间:2023-11-29 01:25:01 26 4
gpt4 key购买 nike

我有以下代码:

SELECT    q21coding, COUNT(q21coding) AS Count 
FROM `tresults_acme`
WHERE q21 IS NOT NULL AND q21 <> ''
GROUP BY q21coding
ORDER BY Count DESC

它返回以下内容:

q21coding                                  Count 
Difficulty in navigating/finding content 53
Positive comments 28
Suggestions for improvement 14
Inappropriate content/use 13
Improve search facility 6
Include information about staff and teams 5
Content needs updating 4
Other 30

您会注意到“其他”是倒数第二个 - 有没有办法确保“其他”始终位于底部,无论计数大小如何?

谢谢

荷马

最佳答案

ORDER BY IF(q21coding = 'Other', 1, 0) ASC, Count DESC

关于MySQL 排序列表问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3904788/

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