TSQL Pivot without aggregate function

后端 未结 9 1947
青春惊慌失措
青春惊慌失措 2020-11-22 09:10

I have a table like this...

CustomerID   DBColumnName   Data
--------------------------------------
1            FirstName      Joe
1            MiddleName           


        
9条回答
  •  南旧
    南旧 (楼主)
    2020-11-22 09:50

    You can use the MAX aggregate, it would still work. MAX of one value = that value..

    In this case, you could also self join 5 times on customerid, filter by dbColumnName per table reference. It may work out better.

提交回复
热议问题