mysql meeting multiple conditions
- by Djeux
I'm having a table, where one ID, can have multiple statuses
| client_id | status_id |
|     1     |     2     |
|     1     |     3     |
|     1     |     5     |
|     2     |     2     |
|     2     |     3     |
|     2     |     6     |
The problem is, to select only those client_id's if they have all the statuses i.e. 2,3,5 (status_id = 2 AND status_id = 3 AND status_id = 5) but mysql doesn't allow that directly.