Created
September 24, 2014 07:15
-
-
Save CyJimmy264/de6ac80f5ccad38e1e4a to your computer and use it in GitHub Desktop.
Drop all tables that start with some prefix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
CONCAT( | |
"DROP TABLE ", | |
GROUP_CONCAT( | |
CONCAT(TABLE_NAME, "\n") | |
) | |
) AS stmt | |
FROM information_schema.TABLES | |
WHERE TABLE_SCHEMA = "DatabaseName" AND TABLE_NAME LIKE "prefix_%" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment