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

Transformation des lignes en colonnes d'Oracle

select login_id
     , sum(case when status_name='open' then count end) open
     , sum(case when status_name='closed' then count end) closed
     , sum(case when status_name='inprogress' then count end) inprogress
     , sum(case when status_name='pending' then count end) pending
from table
group by login_id