查询原表名、列名、列类型等信息的操作是什么?如何操作删除数据库test1下所有前级为tmp的表?
SELECT
*
FROM
information_schema.COLUMNS
WHERE
table_schema = (
SELECT DATABASE
());
select concat_ws (table_name,'drop table test1.',';') from information_schema.COLUMNS
where table_schema = 'test1' and table_name like 'tmp%';
前级是啥意思?前缀吧,找到test1数据,然后找到tmp开头的表,删掉就可以