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.
| 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 MarRow1 Jan 12 Row2 Feb 10Row3 Mar 8 Therefore I want: Select [Date],sum([quantity]) as [date] from TableThanksRheinhardt |
|
|
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] |
 |
|
|
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 |
 |
|
|
|
|
|