MySQL Forums
Forum List  »  General

Re: Delete from all tables
Posted by: Peter Brawley
Date: January 18, 2014 04:22PM

No wildcard DELETE in SQL.

It's relatively easy in an app language like PHP or C# to write a loop that executes a DELETE for a list of tables.

It's less easy but possible to do the same in a MySQL sproc using PREPARE.

But having to do a mass deletion across many tables to delete a particular value is a surefire indicator of incorrect database design. Your database is seriously redundant. Read about normalisation.

Options: ReplyQuote


Subject
Written By
Posted
January 17, 2014 01:39PM
January 18, 2014 03:14PM
Re: Delete from all tables
January 18, 2014 04:22PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.