SQL SERVER 竖表变成横表
时间:2021-07-01 10:21:17
帮助过:3人阅读
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 竖表变成横表
标签: