Could somebody help with my SQL?
I have a table with records such as:
ID | Car_num | Service | Price ---+---------+---------+------ 1 | 001 | sh
SELECT ROW_NUMBER() OVER(ORDER BY Car_num) Id,Car_num ,ISNULL([TV],0) [TV],ISNULL([shower],0) [shower]
FROM ( SELECT Car_num , _Service , ISNULL(Price,0) Price FROM #Table )Data PIVOT ( MAX(Price) FOR _Service IN ([TV],[shower]) )AS PVT