ehlinger
Hall of Fame
Points: 3585
More actions
February 21, 2007 at 9:09 am
#369605
I have two tables: en_entity and cn_contact. They have a common field that links them called enid. If I want to find records where the lastname field in cn_contact is contained anywhere in the name field in en_entity how do I do that?
Adrienne250
Right there with Babe
Points: 737
February 21, 2007 at 10:04 am
#690969
select e.enid, name, lastname
from en_entity e
inner join cn_contact c on c.enid = e.enid
where e.name like '%'+c.lastname+'%'
But you will have the problem of finding the name "Jo Greensleeves" in the lastname "Green".
February 21, 2007 at 10:23 am
#690977
Thanks Adrienne. This will work just fine.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply