Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

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

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

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?

Flowing Fount of Yak Knowledge

2242 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 +'%'

Go to Top of Page
  Previous Topic Topic Next 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.02 seconds. Powered By: Snitz Forums 2000