sql - Need unique value of a column while combining two tables -
this question has answer here:
i'm getting 2 columns 2 different tables using sql server 2005.. used following query..
select [mhd].jobpostingid, [c].candidatename candidate c right join memberhiringdetails mhd on [mhd].memberid=[c].id
it returns following data:
jobpostingid candidatename 60 aaa 60 bbb 63 aaa
null means, candidate erased table.. need output follows:
jobpostingid candidatename 60 aaa, bbb 63 aaa
how this..? if need stored procedure means, ok.. need solution..
agreed mahmoud gamal, duplicate. extracted post , changed tables:
select c.name, stuff((select ','+ c.candidatename candidate c c.id = mhd.memberid xml path(''), type).value('.','varchar(max)'), 1, 1, '') memberhiringdetails mhd
thx omg ponies in post: how create comma-separated list using sql query?
Comments
Post a Comment