sql 先根据排序字段升序,若排序字段未设置,再根据时间降序
1.
order by case when (i_px='' or i_px is null) then 1 else 0 end,i_px desc,ddate desc
2.union
--select * from (select top 100 * from t_table where i_px<>'' and i_px is not null order by i_px asc ) as b
--union all
--select * from (select top 100 * from t_table where i_px='' order by ddate desc) as b
关键词:sql排序