select * from table1 where flag=1
union all
select * from table1 where not flag=1
--order by apply_date desc;
如下问题请教:
我需要把flag为1的记录先选出来放在列表的放在最前面
flag不为1的记录放在后面按时间降序排列
如果用order by apply_date desc就会把flag=1的记录顺序打乱因为要用到分页,分开写两个sql语句也很麻烦