sql >> Base de Datos >  >> RDS >> PostgreSQL

PostgreSQL - orden condicional

la orden condicional se puede realizar con CASE , como aquí:

select *
    from test
order by 
    flag
  , case when flag then date end desc
  , case when not flag then date end asc