3,494
社区成员




select 学号 ,
max(case when px = 1 then 科目 else '') 科目1,
max(case when px = 1 then 成绩 else 0) 成绩1,
max(case when px = 2 then 科目 else '') 科目2,
max(case when px = 2 then 成绩 else 0) 成绩2
from
(
select t.* , row_number() over(partition by 学号 order by 科目) px from tb t
)m
group by 学号