为了账号安全,请及时绑定邮箱和手机立即绑定

java 或者 db2数据库 列传行。将上面的数据转成下面的格式

java 或者 db2数据库 列传行。将上面的数据转成下面的格式

慕斯709654 2018-07-13 13:19:58
    a标签1支行 12支行 03支行 0 b标签1支行 12支行 03支行 1 c标签1支行 22支行 03支行 1    a标签      b标签      c标签1支行 1 1 22支行 0 0 03支行 0 1 1
查看完整描述

1 回答

?
HUWWW

TA贡献1874条经验 获得超12个赞

https://img1.sycdn.imooc.com//5b582efc000168c611410494.jpg

select type,a标签=sum(case when name='a标签' then convert(int,value) else 0 end),
b标签=sum(case when name='b标签' then convert(int,value) else null end),
c标签=sum(case when name='c标签' then convert(int,value) else null end )
from table_1 group by type

查看完整回答
反对 回复 2018-07-25
  • 1 回答
  • 0 关注
  • 714 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号