I'm trying to use the MYSQL statement IN to select only the data I need from my table. For example: I have a field that save categories by ID separated by comma (7,1,10,25,20). If I use this code:
SELECT * FROM cancelamento WHERE ( motivos_int_id IN ( 7 ) )
I get only the rows that start with the number 7. If the data from that row is 8,7,14, for example, it doesn't return any data. Even if I change the code to:
SELECT * FROM cancelamento WHERE ( motivos_int_id IN ( 7,8 ) )
Am I doing something wrong? I need to fetch all the data that has the number 7, for example, regardless of the order of the number 7.