ORACLE:Rows to Columns

1.wm_concat

2.pivot

3.sum(decode/case when)   group by

4.listagg

select

  stu_code

 ,listagg(score, ',')   within group(order by score)

 ,listagg(subject,',')  within group(order by subject)

from stu_subject_score

group by stu_code

;

 

posted @ 2020-06-17 10:45  xinyueliu  阅读(143)  评论(0)    收藏  举报