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 can I get the right result?

Author  Topic 

sunnykj
Starting Member

29 Posts

Posted - 2006-08-04 : 02:19:53
How can I get the right result?
There are two tables:
<Table1>
<bindid> <calNa> <calNb>
1001 john 2
1001 steven 1
1002 lois 3

<Table2>
<bindid>
1001
1002

I want to get the result like this:

<Table3>
<bindid> <Info>
1001 john 2 ,steven 1
1002 lois 3

How to get it?HELP ME please!
Thank you very very much!

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-08-04 : 02:29:32
create a UDF to concat the rows to CSV string. See http://sqljunkies.com/WebLog/amachanic/archive/2004/11/10/5065.aspx


KH

Go to Top of Page

sunnykj
Starting Member

29 Posts

Posted - 2006-08-04 : 04:00:10
Thank you very much!
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-08-04 : 09:44:20
If you use front end application, you can concatenate there also

Madhivanan

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

- Advertisement -