对一个查询两个状态的列表,进行排序, 然后在第一个状态时按照start_time创建时间降序,第二个状态按照开始时间start_time升序.
select * from tableName order by status, case when status = 1 then start_time end, case when status = 2 then start_time end desc;
对一个查询两个状态的列表,进行排序, 然后在第一个状态时按照start_time创建时间降序,第二个状态按照开始时间start_time升序.
select * from tableName order by status, case when status = 1 then start_time end, case when status = 2 then start_time end desc;