Reputation: 69
I need to DELETE rows from a MySQL table based on a JOIN.
Table 1 - players
id gang
--------------
1 5
2 8
3 0
Table 2 - actions
id player
----------------
1 2
2 1
I need to (pseudo code)
DELETE FROM 'actions' WHERE player=(SELECT id FROM players WHERE gang=5)
So it checks through actions table and if it finds a player that is in gang 5 it removes the entry.
Sorry if I'm not making sense
Upvotes: 0
Views: 1032