I am using sql server and i have a table which have two fields
- Name
- Description
I want to select all those rows which contains following strings
('$','%' , 'ac cd' , 'hjd oih')
I am using it like this
select Name , description from table_name
where Description like any (' %$%',' %[%]%','%ac cd%' , '%hjd oih%')
now its giving error when i run this
Incorrect syntax near the keyword 'any'.
thanks ,
If you have
multiple patterns
to search then its better to create aderived table
ortemporary table
to store thepatterns
If you have multiple columns to compare just add expression in the
ON
clauseUpdated: Using View
Not tested but you can do like this
Source