1.正常如果按照某字段升序排列,空值会排到有值的前面;
order by checkpass_time ASC
2.但是我们需要该字段为空的行数据要排到最后面去,这时只需要加上:
order by checkpass_time is null,checkpass_time ASC
1.正常如果按照某字段升序排列,空值会排到有值的前面;
order by checkpass_time ASC
2.但是我们需要该字段为空的行数据要排到最后面去,这时只需要加上:
order by checkpass_time is null,checkpass_time ASC