sql sever默认null最小
升序排序
null值在最前面,若要放在后面,则:
order by case when col is null then 1 else 0 end, col
降序排序
null值在最后面,若要放在前面,则:
order by case when col is null then 0 else 1 end, col desc
标签:排序,end,when,空值,开窗,sql,null,col
From: https://www.cnblogs.com/tian1022/p/17165050.html