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)
 Concatenation

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-01-26 : 08:31:39
Robert writes "In Oracle, I was able to build a function to concatenate muitiple rows into 1 column. For example,

Multiple rows:

Day, amount
Mon, $5
Mon, $10
Mon, $15
Tue, $5
Tue, $10

Into this output:

Day, amount
Mon, $5 $10 $15
Tue, $5 $10 $15

I'm having trouble figuring out how to create this output in sql server 2000.

Thanks"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-01-26 : 08:32:48
This should help:

http://www.sqlteam.com/item.asp?ItemID=2368

And some of these articles too:

http://www.sqlteam.com/searchresults.asp?SearchTerms=csv
Go to Top of Page

abidmisbah
Starting Member

5 Posts

Posted - 2005-01-27 : 07:04:29
hi,
Thanks for your replies.
Robert, could you please reply me the oracle query, you used to concatinate column contents?
thank you
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-01-27 : 07:22:25
I could, if I knew Oracle. I know it doesn't have a COALESCE() function, but DECODE() should work in the same way. Change the "+" in T-SQL to "||" and the rest of the query should work as posted. Beyond that, you'll need to go to an Oracle forum, perhaps here:

http://dbforums.com/
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2005-01-27 : 11:13:28
Well, specifically..this article

http://www.sqlteam.com/item.asp?ItemID=2368


Damn this having to read the thread thing again....mia culpa

And who the hell is Robert?



Brett

8-)
Go to Top of Page
   

- Advertisement -