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
 Transact-SQL (2000)
 Concatenating rows by column

Author  Topic 

mccjeremy
Starting Member

1 Post

Posted - 2005-12-13 : 16:30:39
Hi, say I have the fields: ID, order_number (tells me the order of the line_text eg. order_number 0 = first line) and line_text. It would look like below:
ID order_number line_text
1 0 Hello
2 0 Greetings
3 0 Welcome
4 0 Hello
4 1 there
4 2 friend
I want query so that it concatenates the line_text that has the same ID, which will also eliminate the need for order_number eg:
ID line_text
4 Hello there friend
I have seen other topics on this but I don't quite understand them. Could someone please help me!

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-12-14 : 00:22:31
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
   

- Advertisement -