Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Pivoting

Author  Topic 

ranalk
Starting Member

49 Posts

Posted - 2010-04-11 : 03:33:01
Hi,

I would like to pivot the following table into horizontal

--------------------
Date | occurrences
--------------------
04/2010| 5
03/2010| 6
02/2010| 1
01/2010| 9

Desirable format:
--------------------------
Date |04/2010 |03/2010|...........
occurrences| 5 | 6 |...........

Thanks!

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-04-11 : 03:36:54
see
http://beyondrelational.com/blogs/madhivanan/archive/2008/08/27/dynamic-pivot-in-sql-server-2005.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -