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)
 like from another table

Author  Topic 

cjcclee
Starting Member

33 Posts

Posted - 2014-02-19 : 16:03:12


I want select anying like '%' from select from another table,
how to write the query?

for eample
table A have
value1
value2
value3
....

like '%value1%' or like '%value2%' or like '%value3%'

becasue there are many values, I do not want list all of values. any better to way to do it?

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2014-02-20 : 00:30:48
Check this

SELECT distinct Test1.*
FROM Test1
join Test2
on test1.col1 LIKE '%'+test2.col1 +'%'


--
Chandu
Go to Top of Page
   

- Advertisement -