Don't have Telegram yet? Try it now!
http://www.techmixing.com/2012/04/pivot-table-in-sql-server.html
Pivot and Unpivot table in SQL SERVER