热线电话:13121318867

登录
2020-12-04 阅读量: 693
mysql case when then

系统中导出的是这样

image.png

我需要给变成这样

image.png

解决:逆透视

select 姓名,
 max(case 基础指标 when'组织计划能力'then 他评 else 0 end)组织计划能力,
 max(case 基础指标 when'决策支持'then 他评 else 0 end)决策支持,
 max(case 基础指标 when'授权委责'then 他评 else 0 end)授权委责  #可相应添加条件
from (select 姓名,基础指标,他评 from 表名) 别名
group by 姓名;


104.4366
0
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子