首页 > 编程语言 > 详细

160317(二)、按sort排序,sort为空的在后面

时间:2016-03-17 19:07:32      阅读:201      评论:0      收藏:0      [点我收藏+]
按sort排序,sort为空的在后面
select * from 表名  order by (case when sort is null or sort=‘‘ then 1 else 0 end),sort
 
 
 
select  t.*, t.rowid
  from hs_tr_goods_attach_rel t
 order by (case
            when t.goods_order is null or t.goods_order = ‘‘ then
             1
            else
             0
          end),
          t.goods_order

160317(二)、按sort排序,sort为空的在后面

原文:http://www.cnblogs.com/zrbfree/p/5288426.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!