order by with nullable values mysql code example Example: mysql order by desc null last SELECT * FROM user ORDER BY COALESCE(name, 'zz') DESC