SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Subquery returned more than 1 value
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

calvinkwoo3000
Yak Posting Veteran

Singapore
88 Posts

Posted - 05/10/2012 :  03:31:20  Show Profile  Reply with Quote
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

Sweden
29138 Posts

Posted - 05/10/2012 :  03:34:43  Show Profile  Visit SwePeso's Homepage  Reply with Quote
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

Singapore
88 Posts

Posted - 05/10/2012 :  03:38:32  Show Profile  Reply with Quote
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)

Singapore
16746 Posts

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


KH
Time is always against us

Go to Top of Page

calvinkwoo3000
Yak Posting Veteran

Singapore
88 Posts

Posted - 05/10/2012 :  05:08:48  Show Profile  Reply with Quote
quote:
Originally posted by khtan

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


KH
Time is always against us





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

khtan
In (Som, Ni, Yak)

Singapore
16746 Posts

Posted - 05/10/2012 :  05:30:37  Show Profile  Reply with Quote
welcome


KH
Time is always against us

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000