Hi all,
I've got a column of type SET, with possible values of:
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
My query which uses FIND_IN_SET doesn't find all entries that have one or more of the search criteria:
SELECT * FROM Main1 WHERE Category like '%%' AND FIND_IN_SET('%1,4,5,6,11,12,13%', The_Set_Field) > 0 ORDER BY Date_Created DESC
This will return a row that only has each and all of those in the search 1,4,5,6,11,12,13. But will not return those rows that have for example...just 11, or that have 1,6,11. Why is this returning only an exact match?
I've also tried all of these with the same restrictive results:
SELECT * FROM Main1 WHERE Category like '%%' AND FIND_IN_SET('1,4,5,6,11,12,13', The_Set_Field) > 0 ORDER BY Date_Created DESC
SELECT * FROM Main1 WHERE Category like '%%' AND (FIND_IN_SET('%1,4,5,6,11,12,13%', The_Set_Field) > 0) ORDER BY Date_Created DESC
SELECT * FROM Main1 WHERE Category like '%%' AND (FIND_IN_SET('1,4,5,6,11,12,13', The_Set_Field) > 0) ORDER BY Date_Created DESC
SELECT * FROM Main1 WHERE Category like '%%' The_Set_Field LIKE '%1,4,5,6,11,12,13%' ORDER BY Date_Created DESC
SELECT * FROM Main1 WHERE Category like '%%' The_Set_Field LIKE '1,4,5,6,11,12,13' ORDER BY Date_Created DESC
Any ideas?
Thanks in advance!