oracle列转换成行

列转行在这里插入图片描述

select name "姓名",
sum(decode(salary_type,'基本工资',cnt ,0)) "基本工资",
sum(decode(salary_type,'交通补贴',cnt ,0)) "交通补贴'",
sum(decode(salary_type,'全勤奖',cnt ,0)) "全勤奖",
sum(decode(salary_type,'效益奖',cnt ,0)) "效益奖",
from salary_composite
group by name;