select * from t_dit_task order by field(status, 1001, 1000, 1002);
3 test3 1001
5 test5 1001
6 test6 1001
1 test1 1000
2 test2 1000
4 test4 1000
9 test9 1000
7 test7 1002
8 test8 1002
select * from t_dit_task order by field(status, 1001, 1000, 1002) desc;
7 test7 1002
8 test8 1002
1 test1 1000
2 test2 1000
4 test4 1000
9 test9 1000
3 test3 1001
5 test5 1001
6 test6 1001
MySQL数据库其实很强大,有老多未知的东西值得我们去探索。。。。。。。。。。。
最后
以上就是贤惠钻石最近收集整理的关于mysql 数据库 按列重新排序存储_mysql数据库按照同一字段不同值进行排序的全部内容,更多相关mysql内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复