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
原文地址:https://www.cnblogs.com/zrbfree/p/5288426.html