码迷,mamicode.com
首页 > 数据库 > 详细

oracle行转列

时间:2020-02-09 18:19:31      阅读:56      评论:0      收藏:0      [点我收藏+]

标签:htm   case   oracl   技术   rom   oracle   数学   sele   arc   

select

    Student,

    sum(case Course when ‘数学‘ then Score else null end) 数学,

    sum(case Course when ‘物理‘ then Score else null end) 物理,

    sum(case Course when ‘英语‘ then Score else null end) 英语,

    sum(case Course when ‘语文‘ then Score else null end) 语文

from 

    TEST 

group by Student

 

链接:https://www.cnblogs.com/Mr_JinRui/archive/2011/05/27/2060109.html

技术图片

 

oracle行转列

标签:htm   case   oracl   技术   rom   oracle   数学   sele   arc   

原文地址:https://www.cnblogs.com/wangSoft/p/12287816.html

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