Mysql
 sql >> Datenbank >  >> RDS >> Mysql

Wie erhalte ich die kategoriebezogenen Werte in Bezug auf den Benutzer?

select `User Name`,
    sum(case when Status = 'Open' then 1 end) as Open,
    sum(case when Status = 'Assigned' then 1 end) as Assigned,
    sum(case when Status = 'Closed' then 1 end) as Closed
from Status
group by `User Name`