I was just testing the Pivoting feature in SQL 2005 and just want to know if this is possible
Select STORE, Code1, Code2, Code3
PIVOT (SUM(TotalValue) FOR Code in (Code1, Code2, Code3)) AS PVT
I dono't want to specify the Column Header (Code1, Code2, Code3), it should take whatever available in my code table
Select Code from Code
It is possible that my Changes table will have only 2 codes at a given time but actual Code table has 5 codes. I just want to show all available codes in the code table no matter if they not available in changes table.