Mysql
 sql >> Base de Dados >  >> RDS >> Mysql

MySQL condicional ORDER BY ASC/DESC para coluna de data


Tente isto:
ORDER BY post_status ASC,
CASE post_status WHEN 'future' THEN POST_DATE END ASC,
CASE WHEN post_status <> 'future' THEN post_date END DESC