oracle行转列

时间:2021-11-02 22:11:37

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行转列