日期:2014-05-17 浏览次数:20521 次
select *
from tb
order by case when isnull(col,'')='' then 0 else 1 end,col
select *
from tb
order by (CASE WHEN (ISNULL(col1, '') = '' OR ISNULL(col2, '') = '') THEN NULL ELSE '' END)
select *
from tb
order by case when isnull(col1,'')='' and isnull(col2,'')='' then 0
when isnull(col1,'')='' or isnull(col2,'')='' then 1 else 2 end,col1,col2