一、根據某時間排序,時間爲空則優先排序,不爲空則倒序排序:(適用於一個字段是否爲空決定其排序不一樣時)code
select * from tb_user order by (1- ISNULL(updated) ) , updated desc ;
二、排序