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 2005 Forums
 Transact-SQL (2005)
 correct way to this join

Author  Topic 

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2010-06-24 : 06:27:49
i have a table called applicants and applicantemails
I want to return all records from applicants but I don't want duplicate records when tehre are more then one entry in applicantemails. - is there a way to return that teh emails will show separated by commas as an additional field? and i search where email like 'y%' it will only show those records? Please advise the best way to do this type of join.

(to clarify there is one id in applicants that has many applicantid in applicantemails)

my current query which returns more then 2 row if there is more then 1 email is

select * from applicants a left join applicantemails ae on a.id=ae.applicantid

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-06-24 : 08:10:10
...and i search where email like 'y%'...
on a.id=ae.applicantid and ae.email like 'y%'

...return that teh emails will show separated by commas as an additional field?...
Why? Please do it in your front end.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2010-06-24 : 08:25:03
the problem is then I can't use recorset count - there's no way to do this in a join?
Go to Top of Page
   

- Advertisement -