Mysql batch deletes a table with a prefix or suffix
Oracl has the usage of drop table like, but mysql does not. You can write scripts (not to repeat them) or assemble SQL statements.
Note: My database name is test and there is a table named data. Then I prepare four tables with the same prefix and delete them in batches. This SQL statement can be used to prepare data.
Create table test_1201 SELECT * FROM 'data ';
Create table test_1202 SELECT * FROM 'data ';
Create table test_1203 SELECT * FROM 'data ';
Create table test_1205 SELECT * FROM 'data ';
Select concat ("drop table", GROUP_CONCAT (table_name), ';') AS statement FROM information_schema.tables WHERE table_schema = 'test' AND table_name LIKE 'test _ 100 ';
The preceding SQL statement displays an SQL result. You can run the preceding SQL result on one side.
(Change table_schema (this is the database name) and table_name (this is the name of the data table)
Drop table test_1201, test_1202, test_1203;