Sqlserver
 sql >> Database >  >> RDS >> Sqlserver

Come ruotare le colonne di testo in SQL Server?

Select severity_id, pt.People, Assets, Environment, Reputation
FROM 
(
    select * from COMM.Consequence
) As Temp
PIVOT
(
    max([DESCRIPTION]) 
    FOR [TYPE] In([People], [Assets], [Environment], [Reputation])
) As pt