Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

SQL Statement using LIKE and Subquery?

$
0
0

Hi,

I have two tables, one table is called "Restricted_Words", the other table is called "Content" .   I have a field called "short_desc" in the Content table and a field called "word" in the Restricted Words table.

I want to write a query that will compare all the words in the restricted words table against the short_desc field in the content table and just return all the records in the content table that contain 1 or more of these words.

I started with this:

SELECT short_desc
FROM Content
WHERE short_desc LIKE ( SELECT word FROM Restricted_Words )

I know the above isn't valid and won't work, but that's what I'm trying to do.

Any help appreciated...


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>