I've a tableSALEScreate table sales (empId int not null, prdId varchar(8) not null, priceOfPrd money not null)
I've written pivot table query as one of my requirement, but how to create stored procedure for this pivot table??select empid, [p1] as p1,[p2] as p2,[p3] as p3,[p4] as p4from( select empid,pid,price from sales ) _salespivot( sum(price) for pid in ([p1],[p2],[p3],[p4])) as pvt
are there any tutorials to learn about creating stored procedure for pivot tables?