Mysql
 sql >> Database >  >> RDS >> Mysql

raggruppa le righe in colonne con sum

select name, 
       sum(case when `type` = 'Cash' then `value` else 0 end) as Cash,
       sum(case when `type` = 'Card' then `value` else 0 end) as Card
from your_table
group by name