select * from table order by case when ifnull(sortnum,'')='' then 0 else 1 end desc, sortnum asc;
或者
select * from table order by sortnum is null,sortnum asc;
select * from table order by case when ifnull(sortnum,'')='' then 0 else 1 end desc, sortnum asc;
或者
select * from table order by sortnum is null,sortnum asc;