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

按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
posted @ 2016-03-17 17:58  目标奔雷手  阅读(866)  评论(0编辑  收藏  举报