Answers for "how to convert rows into columns in sql server 2008"

SQL
0

convert rows to columns in sql server

-- convert rows to columns in sql server (PIVOT)
SELECT Firstname, Amount, PostalCode
FROM (
         SELECT value, columnname
         FROM yourtable
     ) d
PIVOT (
    max(value)
    FOR columnname IN (Firstname, Amount, PostalCode)
) piv;
Posted by: Guest on April-13-2021

Code answers related to "how to convert rows into columns in sql server 2008"

Code answers related to "SQL"

Browse Popular Code Answers by Language