mysql批量删除数据表

  • Post author:
  • Post category:mysql


删除要求:

删除数据库test中以’test_’开头的表,并排除test_a,test_b,test_c

SELECT CONCAT(‘DROP TABLE ‘,TABLE_NAME,’;’) FROM information_schema.TABLES WHERE TABLE_SCHEMA=’test’ and TABLE_NAME like ‘test_%’ and TABLE_NAME not in(‘test_a’,’test_b’,’test_c’) INTO OUTFILE ‘d:/del_test.sql’;



版权声明:本文为room_bb原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。