Table "A":
id | name | category_id |
---|---|---|
1 | foo | cat1 |
2 | bar | cat2 |
3 | foob | cat1 |
4 | booh | cat999 |
Table "B":
id | categories |
---|---|
1 | cat1, cat3 |
2 | cat2, cat1, cat3 |
3 | cat1 |
I'd like to find rows of table "A" with A.category_id NOT IN B.categories
. As you see, the problem is "B.categories" are comma separated values, I don't see how to use "LIKE" in such case.
In my example I must be able to find row #4 of table "A".