sql 语句行转列,如下图

如题所述

第1个回答  2015-10-26
select capacity

case when 100 then 风电
when 400 then 光伏
。。。。。
end

或者
select * from pivot1 pivot(max(capacity) for sou_type in ([风电],[生物质],[垃圾发电],[沼气发电]))a
相似回答