Hi i need to control if my value is exists in a comma seperated list.
For example
DECLARE @list NVARCHAR = '6,3,67,34';
SELECT Column1, Column2 FROM Table1
WHERE PATINDEX ('%' + CONVERT(NVARCHAR, Table1.ID) + '%', @list)
It should return rows which ID field is 6, 3, 67 or 34.
How can i do with or without PATINDEX?
Add leading and trailing commas to both
@listandTable1.IDin the search: