I need assistance building this MySQL query. Basically I am trying to eliminate users with a certain ID_NUM while grouping the USR_ID together.
Here is the sample table:
usr_id id_num
USR1 101
USR2 101
USR3 101
USR1 201
USR2 203
USR3 204
Here is the query that does not work:
SELECT usr_id FROM table WHERE id_num = 101 AND id_num != 201 GROUP BY usr_id
I am trying to get back the following:
usr_id id_num
USR2 101
USR3 101