mysql orderby field that might be null code example Example: mysql order by desc null last SELECT * FROM user ORDER BY COALESCE(name, 'zz') DESC