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
 General SQL Server Forums
 New to SQL Server Programming
 Waterfall View

Author  Topic 

Rheinhardt
Yak Posting Veteran

66 Posts

Posted - 2011-02-21 : 01:55:30
Hi,

I am doing a waterfall view and wan't my Column name to be the same as the Row data, example:

Column1 Column2 Column3 Column4
Jan Feb Mar
Row1 Jan 12
Row2 Feb 10
Row3 Mar 8

Therefore I want: Select [Date],sum([quantity]) as [date] from Table

Thanks
Rheinhardt

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2011-02-21 : 02:14:46
if you are using SQL 2005 / 2008, check out the PIVOT operator


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2011-02-21 : 10:59:50
Also have a look of dynamic pivot operator:
http://sqlblogcasts.com/blogs/madhivanan/archive/2008/08/27/dynamic-pivot-in-sql-server-2005.aspx
Go to Top of Page
   

- Advertisement -