I have a table with a varchar categoryIds column. It contains some identifiers separated by commas, for example:
id categoryIds -------------------- 1 3,7,12,33,43
I want to make a select statement and check if an int exists in this column. Something like that:
select * from myTable where 3 in (categoryIds)
I know this is possible in MySQL by doing this , but can it be in SQL Server as well?
I tried casting int to char, which runs the following statement:
select * from myTable where '3' in (categoryIds)
But this does not look like out of the box support for comma-separated lists, since it does not return anything.
sql sql-server
Schileru
source share