SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 like from another table
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

cjcclee
Starting Member

33 Posts

Posted - 02/19/2014 :  16:03:12  Show Profile  Send cjcclee an AOL message  Reply with Quote


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
Flowing Fount of Yak Knowledge

India
2168 Posts

Posted - 02/20/2014 :  00:30:48  Show Profile  Reply with Quote
Check this

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


--
Chandu
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000