so how would you write the sql to find '1,3,7'
you would have to break it apart, and do a separate FIND_IN_SET for each of 1, 3, and 7, or alternatively something like
Code:
where concat(',',field,',') like concat('%,', 1, ',%')
and concat(',',field,',') like concat('%,', 3, ',%')
and concat(',',field,',') like concat('%,', 7, ',%')
and the only way to break up '1,3,7' is by using a script
(actually, you could probably do it with a cross-join to an integers table (numbers of commas in '1,3,7' string plus 1, but now it's getting really complex as sql)
my point was, don't try to do this with sql, it's (next to) impossible, you'll have to write some code anyway
Bookmarks