SQL LIKE ANd NOT LIKE

Be careful, presumably you would want strings with "hand" and "Andy", as examples, to appear in your results, so probably do this:

WHERE column_name LIKE '%an%' AND 
    '.' + column_name + '.' NOT LIKE '%[^a-z]and[^a-z]%'
1 Like