小编moo*_*onw的帖子

MySQL:仅对一列进行条件 ORDER BY

您好,感谢您花时间阅读这个问题。

我正在使用 MySQL,并且我想使用 ORDER BY 对一个特定列对结果进行排序,但必须根据该列的特定条件对结果进行排序。例如,对于下表,我想ORDER BY 'group'首先显示9,7,6 'group' items和,最后显示10,8,5 'group' items

names     group
--------- ------
susanita  10
miguelito 5
mafalda   7
manolito  8
libertad  6
felipe    9
guille    8
Run Code Online (Sandbox Code Playgroud)

提前致谢。

mysql order-by condition

3
推荐指数
1
解决办法
6591
查看次数

标签 统计

condition ×1

mysql ×1

order-by ×1