MS SQL Server pivot table with subquery in column clause
问题 Im sure this is a simple technique although I can't find an answer so far! I have TIMESTAMP | POINTNAME | VALUE 2012-10-10 16:00:00 AHU01 20 2012-10-10 16:00:00 AHU02 25 2012-10-10 16:00:15 AHU01 26 2012-10-10 16:00:15 AHU02 35 etc... ( for approx 800 POINTNAMES) with many pointnames I dont want to list each one in the 'IN' clause of the pivot 'FOR' (as syntax given below) definition but would like to use perhaps a subquery. So what I would like is all the POINTNAME values as columns with A