sql server - How to search multiple strings or chars in a field in sql -
I am using sql server and i have a table with two fields
- < Li>
- Description
I want to select all the rows containing the following strings
('$', ' I am using it like this:
Select the name, description from table_name where there is any way Details of ('% $%', '% [%]now giving error when I run it
Incorrect syntax keyword 'any'Thanks,
if You have
many patternspattern stored on To include thederived table ortemporary table code> announcement @bugger table (pattern VARCHAR (20)); Patterns value ('% $%'), ( '% [%]%'), ('% AC cd%'); SELECT a. * Add a comment from the table_name @ Patterns P On (A. P. Pattern like a description);To compare multiple columns, simply add the expression from
ON sectionSELECT a.). @ Patterns P On (A.S.A.L.P.P. Pete Tern) or (A.P.Parten, like A. Column 2); Updateas pattern pattern (select 'Association'% ('% Device%') Select All '% Sales% Select 'Select Union'% AC CD% ') Select. * From a table_name to a join pattern P (a.Description LIKE p.pattern) GOdid not test but you can do this
< / Div>
Comments
Post a Comment