PostgreSQL - conditional ordering PostgreSQL - conditional ordering postgresql postgresql

PostgreSQL - conditional ordering


conditional order can be performed with CASE, like here:

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