This table has a text column that stores references to some other records in CSV format, for example:
+----+----------------+
| id | linked_folders |
+----+----------------+
| 90 | NULL |
| 91 | NULL |
| 92 | 123,1,4,40 |
| 93 | 123,1 |
| 94 | NULL |
| 95 | 235,8 |
| 96 | 90 |
| 97 | NULL |
| 98 | NULL |
| 99 | NULL |
+----+----------------+
$id = 90;
SELECT * FROM my_table WHERE id = $id OR $id is in linked_folders
Pseudo query above should return rows 90 and 96.
I would like to match records where some exact value I have IS on this field.
I was thinking a LIKE wouldn't work here because I don't know if there is a comma before and/or after.
What alternative do I have?