一道SQL面试题——表行列数据转换(表转置)
SQL语句如下:

select
country, 
sum(case when type='A' then money end) as A,
sum(case when type='B' then money end) as B,
sum(case when type='C' then money end) as C
from table1
group by country

本文转自:https://blog.csdn.net/Eastmount/article/details/50559008

相关文章:

  • 2022-01-28
  • 2021-11-04
  • 2022-12-23
  • 2021-08-12
  • 2022-01-19
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-19
  • 2022-12-23
  • 2021-04-29
  • 2021-09-02
  • 2022-01-12
  • 2022-12-23
  • 2021-12-22
相关资源
相似解决方案