level 1
我个表,其中有三个字段,一个是完成状态(未完成,已完成),一个是严重状态(偶发、一般、严重),一个是添加时间
我现在排序的方式是:order by 完成状态 asc,严重状态 desc ,添加时间 desc
但是领导想要 未完成的按上面的顺序排
已完成的,只按添加时间 desc 排
而且还是分页显示的,这个我想不出有什么好办法,请问各位大神有没有碰到过这种情况,感谢!!!
2022年10月21日 02点10分
1
level 13
select xxx
where 未完成
order by xxxxx
union all
select xxx
where 已完成
order by 添加时间 desc
2022年10月21日 06点10分
2