Answers for "sql pivot without aggregate"

SQL
0

sql pivot without aggregate

WITH pivot_data AS
(
SELECT customerid, -- Grouping Column
dbcolumnname, -- Spreading Column
data -- Aggregate Column
FROM pivot2 
)
SELECT customerid, [firstname], [middlename], [lastname]
FROM pivot_data
PIVOT (max(data) FOR dbcolumnname IN ([firstname],[middlename],[lastname])) AS p;
Posted by: Guest on June-09-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language