标签:
将列表转换为透视表的方法
SELECT kh as 款号,pm as 品名,ys as 颜色
,isnull([95],0)as ‘95‘
,isnull([100],0)as ‘100‘
,isnull([105],0)as ‘105‘
,isnull([110],0)as ‘110‘
,isnull([115],0)as ‘115‘
FROM(select * from hj)as a
pivot(
max([sl]) for [cm] in([95],[100],[105],[110],[115])
)as b
标签:
原文地址:http://www.cnblogs.com/vscs/p/4489911.html