Answers for "convert row data to column in sql server"

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 "convert row data to column in sql server"

Code answers related to "SQL"

Browse Popular Code Answers by Language