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)
 How to combine multiple rows to one?

Author  Topic 

lcpx
Yak Posting Veteran

54 Posts

Posted - 2005-12-05 : 06:07:28
how to combine multiple rows to one.

table:

ID Name Value
1 xx 10
1 xx 20
1 xx 15
2 oo 10
2 oo 12
2 oo 8

How can I use SQL to get the result like below:

1 xx 10,20,15
2 oo 10,12,8

thanks very much for your help!

I am using Oracle by the way.

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-12-05 : 06:11:58
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

lcpx
Yak Posting Veteran

54 Posts

Posted - 2005-12-05 : 06:15:48
Thanks for your response, but what I want is one sql query. I don't want to PL/SQL involved in. Cheers!
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-12-05 : 06:21:07
quote:
Originally posted by lcpx

Thanks for your response, but what I want is one sql query. I don't want to PL/SQL involved in. Cheers!


No. You should use Function that is called in your Select statement
Read that article fully

Madhivanan

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

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2005-12-05 : 08:00:26
quote:
I don't want to PL/SQL involved in

this is a Microsoft SQL Server forums. Only T-SQL here no PL/SQL

-----------------
[KH]
Go to Top of Page
   

- Advertisement -