Oracle
 sql >> Datenbank >  >> RDS >> Oracle

Oracle-Zeilen-zu-Spalten-Umwandlung

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