I have written a query to generate a Pivot. The code is running absolutely fine. Instead of hard coding the value("1","2","3"), IS it possible to write a subquery?
SELECT *
FROM (
SELECT * from #Registered2
) as s
PIVOT
(
SUM(s.Registered_customer_Count)
FOR [Offer_cover_id] IN ("1","2","3")
)AS pvt