1 SELECT concat('DROP TABLE IF EXISTS ', table_name, ';') 2 FROM information_schema.tables 3 WHERE table_schema = 'test_db';
step1:select出所有要删除表的删除语句,其中 test_db 是数据库下的模式名称,
step2:执行step1输出的SQL语句即可
1 SELECT concat('DROP TABLE IF EXISTS ', table_name, ';') 2 FROM information_schema.tables 3 WHERE table_schema = 'test_db';
step1:select出所有要删除表的删除语句,其中 test_db 是数据库下的模式名称,
step2:执行step1输出的SQL语句即可
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。