Converting rows into colums In Sql Server for Cross Tab Report
Sometimes it is necessary to rotate results so that [the data in] columns are presented horizontally and [the data in] rows are presented vertically. This is known as creating a PivotTable®, creating a cross-tab report, or rotating data.
visit : http://www.sqlservercentral.com/articles/T-SQL/63681/ .It require registration .Enjoy learning