排序字段为record_time
;
1、使用order by record_time desc
实现降序时,record_time
为null
数据的会排在数据的最后面;
但是,order by record_time
升序时,record_time
为null
的数据则会排在最前面,如果想要将record_time
为null
的数据排在最后,就需要加上is null
。
SELECT
*
FROM
rescue_progress_log a
WHERE a.rescue_id = xxxx
ORDER BY a.record_time is null, a.record_time ASC, a.create_time ASC
网友评论