I'm having a similar issue. I know that storing a
comma-delimited list is bad modeling, but I don't have the option
to change the data model at this point.
So, here's some sample data:
Table = Programs
ID......NAME.............AGES
1........Volleyball......11,12,13,14,15
2........Soccer...........10,11,12,13,14,15
3........Baseball........12,13,14
4........Basketball.....12,13,14,15
5........Swimming......9,10,11,12,13,14
and the query:
SELECT ID,Name, Ages
FROM Programs
WHERE Ages IN (12)
but this returns only those records that have "ages"
beginning with 12:
3....Baseball.......12,13,14
4....Basketball....12,13,14,15
Should this query be returning all records that contain 12?
Is there a better way to match values within a list?
Thanks for any insight!!