Delete all accounts with their statuses are inactive and delete related contacts belong to deleted accounts.
Be careful when executing this script on your database.
DELETE account.*, contact.*
FROM account a
INNER JOIN contact c
ON a.account_id = c.account_id
WHERE a.is_active = 0
Tuesday, January 19, 2010
Cross Table Delete
at 1:10 AM
Labels: MySQL, MySQL Query
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment