I’ve a sql table in which one of the column ‘Codes’ consists of multiple character values sperated by ‘|’.
(For ex.:|0000000171|0000001192|0000003498|0000003569|).
Now in a query inorder to check a single value if it exists in the colum ‘Codes’, One row is succesfully returned if I use:-
charindex('0000000171', Codes) > 0
Question:- What could be the correct query in SQL if I want to
search more than one value, if any of them exist in column ‘Codes’.
For ex. If need to search the existence of three values 0000000171, 0000000172, 0000000173 in column ‘Codes’, following syntax return Nothing:-
charindex('0000000171,0000000172,0000000173', Codes) > 0
Please advice …
What about: