现有数据如下:

SQL SERVER 竖表变成横表

Sql:

select a.MODELID,
       max( case a.PNAME  when'计划开始' then a.PVALUE end) as RStart,
       max( case a.PNAME when '计划结束' then a.PVALUE end) as Rend     
           
         from TB_CONSTRUCTION_PROPERTY as a
         group by a.MODELID

结果:
SQL SERVER 竖表变成横表

 

相关文章:

  • 2022-12-23
  • 2022-02-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-08
  • 2022-12-23
  • 2022-02-08
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案