pivot和unpivot函数用法,unapt

UNPIVOT的应用

select distinct NO,YEAR,MONTH,budgetversion,ISNULL(Sales,0) AS Sales,

getImport_History where YEAR=YEAR(GETDATE())

结果集
select *
from (结果集)A
UNPIVOT(
Budget_Amount(要取值) for attribute(要取字段) in(
[Sales]

,Trade
)
) as upv

Published by

风君子

独自遨游何稽首 揭天掀地慰生平

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注