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
 General SQL Server Forums
 New to SQL Server Programming
 Subquery returned more than 1 value

Author  Topic 

calvinkwoo3000
Yak Posting Veteran

98 Posts

Posted - 2012-05-10 : 03:31:20
Table A
-----------------------
Proj_Code Proj_desc
AAAAAAAA description


Table_Member
------------------------
Proj_Code MemberName
AAAAAAAA Name1
AAAAAAAA Name2

I want result as below:

Proj_Code Proj_desc MemberName
AAAAAAAA description Name1, Name2

Please Help, thank you.


SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2012-05-10 : 03:34:43
So, how does your current code look like?



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

calvinkwoo3000
Yak Posting Veteran

98 Posts

Posted - 2012-05-10 : 03:38:32
quote:
Originally posted by SwePeso

So, how does your current code look like?



N 56°04'39.26"
E 12°55'05.63"




Select Proj_Code, Proj_desc, MemberName as
(Select MemberName from Table_Member M
where M.Proj_Code = A.Proj_Code)
from table A
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2012-05-10 : 04:15:10
use the "for xml path" method describe here
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=81254


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

calvinkwoo3000
Yak Posting Veteran

98 Posts

Posted - 2012-05-10 : 05:08:48
quote:
Originally posted by khtan

use the "for xml path" method describe here
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=81254


KH
[spoiler]Time is always against us[/spoiler]





KhTan, Thank you again, i got it from the link given by you.... :)
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2012-05-10 : 05:30:37
welcome


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -