Pivot tables

Pivot tables in SQL Server. A simple sample.
http://blogs.msdn.com/b/spike/archive/2009/03/03/pivot-tables-in-sql-server-a-simple-sample.aspx

Using PIVOT and UNPIVOT
http://technet.microsoft.com/en-us/library/ms177410(v=sql.105).aspx

Simple Way To Use Pivot In SQL Query
http://www.codeproject.com/Tips/500811/Simple-Way-To-Use-Pivot-In-SQL-Query