test表:

sql列转行查询

执行列转行sql:

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) 英语
from 
    test 
group by 
    student

得到结果:

sql列转行查询

 

相关文章:

  • 2021-10-18
  • 2021-10-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-27
  • 2021-05-30
猜你喜欢
  • 2021-06-01
  • 2022-12-23
  • 2021-08-28
  • 2022-01-17
  • 2021-11-26
  • 2021-06-26
  • 2021-10-07
相关资源
相似解决方案