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)
 Columns into Rows

Author  Topic 

somu_p
Starting Member

13 Posts

Posted - 2008-02-29 : 04:18:43
Hi,
I've a table called months with one column month. The result set will be
month
=====
Jan
Feb
Mar
...

Now i want to convert those values as rows. Means,

Jan Feb Mar
===========

Suggest me a solution for the above problem.


Thanks
Somu

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-02-29 : 04:42:21
Suggestions :
http://sqlblog.com/blogs/adam_machanic/archive/2006/07/12/rowset-string-concatenation-which-method-is-best.aspx
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=81254


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

Go to Top of Page

Abu-Dina
Posting Yak Master

206 Posts

Posted - 2008-02-29 : 05:17:33
quote:
Originally posted by somu_p

Hi,
I've a table called months with one column month. The result set will be
month
=====
Jan
Feb
Mar
...

Now i want to convert those values as rows. Means,

Jan Feb Mar
===========

Suggest me a solution for the above problem.


Thanks
Somu



Please refer to PIVOT and UNPIVOT in BOL for further help + examples.
Go to Top of Page
   

- Advertisement -