Question Delete row, where there's another row with matching values?

Hello, l am needing some help writing a mysql query to clean up a database that l have. I believe this is a simple problem, but l can’t seem to wrap my novice mysql understanding around how this would be done.

I have a single table, lets say this is it for example:

row_id, list_id, subscriber_id
0, 1, 100
1, 2, 100
2, 1, 99
3, 1, 98
4, 2, 97
5, 1, 96

What I need to do is delete any row where list_id = 2 WHERE there is another row/instance of the same subscriber_id with a list_id = 1.

So the query would need to delete row_id 0 in the above table example.

Can anyone help me with this?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.