Mysql
 sql >> Base de données >  >> RDS >> Mysql

MySQL Orderby a number, Empty Strings (ou 0's) Last

SELECT * 
FROM tablename 
WHERE visible=1 
ORDER BY 
    case when position in('', '0') then 1 else 0 end,
    position ASC, 
    id DESC