我有一张这样的表:
Source Participation Improvement ReportType
A 1 2 Grantee
B 3 4 National
我想将其转入:
Source Category Grantee National
A Participation 1 3
B Improvement 2 4
到目前为止我所拥有的,但我甚至不知道它是否可能。我应该使用枢轴和unpivot吗?或者只是一个支点?
select Source, [National]
from
(
MyTable
) d
UNPIVOT
(
[National] FOR Source
in (Participation,Improvement)
) piv