sql pivot without aggregate

Solutions on MaxInterview for sql pivot without aggregate by the best coders in the world

showing results for - "sql pivot without aggregate"
Facundo
01 Mar 2018
1WITH pivot_data AS
2(
3SELECT customerid, -- Grouping Column
4dbcolumnname, -- Spreading Column
5data -- Aggregate Column
6FROM pivot2 
7)
8SELECT customerid, [firstname], [middlename], [lastname]
9FROM pivot_data
10PIVOT (max(data) FOR dbcolumnname IN ([firstname],[middlename],[lastname])) AS p;
11
similar questions
queries leading to this page
sql pivot without aggregate