mysql数据库按照同一字段不同值进行排序
2015-06-07 00:00
666 查看
摘要: mysql数据库按照同一字段不同值进行排序
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数据库其实很强大,有老多未知的东西值得我们去探索。。。。。。。。。。。
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中的integer 数据类型
- mysql中int、bigint、smallint 和 tinyint的区别与长度
- mysql load data 导出、导入 csv
- source命令执行SQL脚本文件
- linux下mysql添加用户
- mysql procedure
- mysql触发器
- MySQL 备份和恢复策略
- mac下安装mysql(转载)
- mysql 修改编码 Linux/Mac/Unix/通用(杜绝修改后无法启动的情况!)
- MySQL数据的导出、导入(mysql内部命令:mysqldump、mysql)
- mysql数据行转列
- Linux下修改MySQL编码的方法
- MySQL Server 日志
- MySQL 安全事宜
- MySQL 备份与恢复
- MySQL 优化
- MySQL 数据类型
- Facebook's New Real-time Messaging System: HBase to Store 135+ Billion Messages a Month