码迷,mamicode.com
首页 > 其他好文 > 详细

行列转换

时间:2017-12-13 23:19:07      阅读:117      评论:0      收藏:0      [点我收藏+]

标签:sele   行列转换   log   cas   gpo   post   body   sel   rom   

select 姓名 as 姓名 ,
max(case 课程 when ‘语文‘ then 分数 else 0 end) 语文,
max(case 课程 when ‘数学‘ then 分数 else 0 end) 数学,
max(case 课程 when ‘物理‘ then 分数 else 0 end) 物理
from tb
group by 姓名

行列转换

标签:sele   行列转换   log   cas   gpo   post   body   sel   rom   

原文地址:http://www.cnblogs.com/whatarey/p/8034810.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!