Hi guys, here is my question:
I want to make a query like these (and don't worry about the sintax of the next query... I know is not the right one, this is just to give the idea):
Code: Select all
SELECT * FROM this_table WHERE category_field = 3;
Now, my problem is that the "category_field" contains an array like "1,3,15,43,...", which means that this registry apply for all those categories. I can't just use a
Code: Select all
SELECT * FROM this_table WHERE category_field LIKE %3%;
sentence since the array might have a 43 and therefore the registry would be selected and that would be incorrect, because this registry do not below to category "3"...
Also, I can't use
Code: Select all
SELECT * FROM this_table WHERE category_field LIKE %",3,"%;
since the 3 might be the first or last value of the array in the "category_field" and therefore it won't have a "," before or after the value...
Any ideas about how to make this? I would really appreciate your help!
