Perhaps the answer is very simple, but I cannot find the correct MySQL query that does what I want.
I have a user table:
| id_user | name | action_type | +---------------------------------+ | 1 | joshua | 1,13,12,40 | | 2 | joshua | 2,8 |
And I want to select only rows that have the exact number in the action_type column.
action_type is stored in MySQL as TEXT.
I tried this:
SELECT * FROM user WHERE action_type LIKE '%2%'
But he selected lines with 12, which is not what I want: (
This may be possible with the IN operator, but I could not find the correct way to use it.
source share