您的位置:首页 > 博客中心 > 数据库 >

oracle行转列

时间:2022-03-15 18:05

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

技术图片

 

热门排行

今日推荐

热门手游