1.使用CONCAT函数连接组成删除语句
MariaDB [wiki_db]> select concat('drop table if exists ',table_name,';') from information_schema.tables where table_schema='wiki_db';
+--------------------------------------------------+
| concat('drop table if exists ',table_name,';') |
+--------------------------------------------------+
| drop table if exists wiki_user; |
| drop table if exists wiki_actor; |
| drop table if exists wiki_user_groups; |
| drop table if exists wiki_user_former_groups; |
| drop table if exists wiki_user_newtalk; |
| drop table if exists wiki_user_properties; |
| drop table if exists wiki_bot_passwords; |
| drop table if exists wiki_page; |
| drop table if exists wiki_revision; |
| drop table if exists wiki_revision_comment_temp; |
| drop table if exists wiki_revision_actor_temp; |