0
如何透視下表。下面給出的表格格式:帶有列標題的SQL Server不透明表作爲元組
的逆轉置查詢即
select
u.parentcustomerid, u.Parentcustomer, u.Billed_Rate
from
#tbl_ONOFFPVHZRate s
unpivot
(Billed_Rate for details in ([PV ON rate],[PV Off rate],[HZ ON rate],[HZ Off rate])) u
parentcustomerid Parentcustomer Billed_Rate PV/HZ/onOFF
1 ACI 346.0314334 PV on rate
1 ACI 217.967008 PV off Rate
1 ACI 0 HZ on Rate
1 ACI 187.1165653 HZ off Rate