Wednesday, July 2, 2014

SQL Statement using LIKE and Subquery?

or you could simply tweak your first query as below



SELECT short_desc
FROM Content c
WHERE EXISTS ( SELECT 1 FROM Restricted_Words WHERE c.short_desc LIKE '% ' + word + ' %')



Notice the space characters inside condition using LIKE. Thats required if you want to match on whole word. Otherwise you can dispense with it and use the same condition as previous suggestion.




Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://ift.tt/19nLNVq http://ift.tt/1iEAj0c


No comments:

Post a Comment