mercredi 25 février 2015

Row as column in Sql server 2008

I am working with sql server 2008 i have a temp table which returns the below result


Location Month value US January 10 US February 10 US March 10 US April 10 US May 10 US June 10 UK January 10 UK January 10 UK February 10 UK February 10 UK March 10 UK March 10 UK April 10 UK April 10 UK May 10 UK May 10 UK June 10 UK June 10


I want to get the result as below


Location January February March Q1 April May June Q2 US 10 10 10 30 10 10 10 30 UK 20 20 20 60 20 20 20 60


how to query to get the above result using sql server 2008?


Aucun commentaire:

Enregistrer un commentaire