sql排序 根据字段内容,以及根据内容进行计算排序
2017-01-03 17:51
239 查看
1,当前时间与字段时间进行对比,分三种情况然后排序
2,根据字段具体值,进行排序
2,根据字段具体值,进行排序
SELECT * from 表名(table) order by case when table.start <='2017-01-03' AND table.end >='2017-01-03' then 1 when table.end <'2017-01-03' then 2 when table.start is null AND table.end is null then 3 end, case when table.type=1 then 1 when table.type=3 then 2 when table.type=2 then 3 when table.type=4 then 4 end;
相关文章推荐
- 根据value字段对map进行排序
- 在Oracle中根据内容进行排序
- 用coredata碰上需要根据两个字段的和进行排序
- geotrellis使用(十一)实现空间数据库栅格化以及根据属性字段进行赋值
- 基于JavaScript实现Json数据根据某个字段进行排序
- 根据value字段对map进行排序
- java 对象排序,根据多个字段进行排序
- C语言单向动态链表程序,实现链表的建立,合并,重新排序,链表元素的插入与删除,以及根据元素成员的值进行元素删除。
- php根据某字段对多维数组进行排序的方法
- PHP 二维数组根据某个字段进行排序
- 对DataTable中的内容进行排序,并根据内容进行分割成多个DataTable
- jQuery_review之table根据内容分组进行折叠显示以及,折叠之后高亮显示的实现
- 根据某字段内容排序
- oracle根据某一字段的内容排序
- 规则文本数据文件根据关键字段进行排序的实现
- 容易遗忘的Comparable:一个结果集List,里面有很多的对象,要求根据对象的指定(age)字段进行排序
- [DataTable] datatable根据表中的字段进行排序
- 根据列表中的指定字段进行排序
- php二维数组根据某字段排序(对查询结果集进行排序)
- 基于JavaScript实现Json数据根据某个字段进行排序