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 2000 Forums
 SQL Server Development (2000)
 Multiple lines into one

Author  Topic 

jparker
Posting Yak Master

118 Posts

Posted - 2006-02-20 : 05:12:16
Hello

I would like to turn the following number of rows in a table

7 | 123456789
8 | 123456789
11 | 123456789
4 | 999999999
5 | 999999999

into the following output via a select statement

7, 8, 11 | 123456789
4, 5 | 999999999

I can do this with a temporary table and a loop but wondered if there were something more efficient out there

Thanks in advance

JP

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-02-20 : 05:17:35
Refer this
http://sqljunkies.com/WebLog/amachanic/archive/2004/11/10/5065.aspx?Pending=true

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

jparker
Posting Yak Master

118 Posts

Posted - 2006-02-20 : 05:30:06
thank you very helpful
Go to Top of Page
   

- Advertisement -