Hi,

 

I need to know the syntax I can use for a certain delete statement. This is
the idea:

- A table with users, which has at least these fields, a user id field and a
field containing its status (active, disabled, review).
- A table that links certain users to each other, containing at least these
fields: a link id, a user id 1 and a user id 2.

Now I want to delete all records from the second table when any of the
linked users is disabled, eg something like this:

DELETE FROM `matches` WHERE `userAid` IN ('SELECT `ID` FROM `users` WHERE
`status`='disabled')' OR `userBid` IN ('SELECT `ID` FROM `users` WHERE
`status`='disabled')'



The query must be run on a mysql server version 4.0.24

 

Thanks for any help with this one,

Mark

Reply via email to