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 2000 Forums
 Transact-SQL (2000)
 Left outer join based on 'like'

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-03-06 : 07:26:45
Rinus Heer writes "Hello supporters,

I have a question concerning SQL (left outer) join.

I like to know if it's possible to create/use a join based on "column a like '%column b%'" (value within column a equal to part of the value within column b).

For example:

select a.x, y.b
from a left outer join b
on a.x like '%y.b%'

Hope to hear from you soon.

Kind regards, Rinus Heer."

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-03-06 : 08:31:19
Yes, you pretty much had it:

select a.x, y.b
from a left outer join b
on a.x like '%' + y.b + '%'



Go to Top of Page
   

- Advertisement -