SQLTeam.com | Weblogs | Forums

SQL Server

Convert the following query to be pivoted, using PIVOT() .

SELECT CategoryID, AVG(UnitPrice)
FROM Products
GROUP BY CategoryID;

see
http://www.nigelrivett.net/SQLTsql/Pivot_Statement.html