mysql sort field is empty at the bottom surface

 Sort field OrderID;

1, when the order by using orderid desc descending implemented, OrderID data will be null at the bottom surface of the data;

However, in ascending order by orderid, orderid is null data will be at the top, if you want to orderid

For the null data in the last row, you need to add is null.

 

select * from user u order by u.orderid is null, u.orderid

 



Original link: https: //blog.csdn.net/w592376568/article/details/79217351

Guess you like

Origin www.cnblogs.com/lxwphp/p/11322910.html