Select Records Where Value Is In List
Posted on 2003-11-19
I have a table with a field that contains a comma delimited list of IDs, e.g,
I need to write a query that can select those records where a particular number is in that list, e.g.,
SELECT * FROM tblName WHERE 4 IN (SELECT fldCommaDelimited FROM tblName)
The problem is the comma delimited list is of type nvarchar and I get an error saying it cannot convert to type of smallint. Is there a direct way to do this or do I have to do multiple queries, store to a temp table, etc...