批量删除的预制作:
SELECT CONCAT( 'DROP TABLE ', GROUP_CONCAT(table_name) , ';' ) AS statement FROM information_schema.tables WHERE table_schema = 'xda' AND table_name LIKE 'xda_event_2017%';
得到的sql语句:
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| DROP TABLE xda_event_20171128,xda_event_20171129,xda_event_20171130,xda_event_20171201,xda_event_20171202,xda_event_20171203,xda_event_20171204,xda_event_20171205; |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
删除指定范围的记录
delete from xda_event_20171202 where event_id>10;