17,377
社区成员
发帖
与我相关
我的任务
分享
select name,mon,
max(case when 险种='养老保险' then 险种 end) 险种1,
max(case when 险种='养老保险' then 公司缴费 end) 险种1公司缴费,
max(case when 险种='养老保险' then 个人缴费 end) 险种1个人缴费,
max(case when 险种='工伤保险' then 险种 end) 险种2,
max(case when 险种='工伤保险' then 公司缴费 end) 险种2公司缴费,
max(case when 险种='工伤保险' then 个人缴费 end) 险种2个人缴费,
...
from tab
group by name,mon;