I have the following table:
... | parents_id | ...
________________________
... | 1, 40, 7 | ...
... | 10, 4, 7, 1 | ...
... | 45, 40, 1, 7 | ...
...
As per documentation - FIND_IN_SET
's second argument is a comma separated list. So the value 10, 4, 7, 1
being split by a comma becomes to the following 4 values:
10
4
- space followed by 47
- space followed by 71
- space followed by 1None of them equal to 1
Solution: stop using this approach and normalize your schema to use one-to-many (or many-to-many).