Sqlserver
 sql >> Base de données >  >> RDS >> Sqlserver

Comment faire pivoter des colonnes de texte dans 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