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)
 LIKE in JOIN?

Author  Topic 

jimmy.hunt
Starting Member

21 Posts

Posted - 2006-02-27 : 17:06:21
Can you write a LIKE in with a join? How do you do this?

Thanks!
James


James Hunt

rfrancisco
Yak Posting Veteran

95 Posts

Posted - 2006-02-27 : 17:29:34
You can have a LIKE as your JOIN clause, as follows:

SELECT *
FROM Table1 INNER JOIN Table2
ON Table1.Column1 LIKE '%' + Table2.Column1 + '%'

Hope this helps.

http://www.sql-server-helper.com
Go to Top of Page
   

- Advertisement -