FROM information_schema.TABLES
WHERE TABLE_SCHEMA = '库名' AND AUTO_INCREMENT > 1;
清除数据并重置自增为1
SELECT CONCAT('TRUNCATE TABLE ', table_name, ';') AS `query`
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = '库名';
WHERE TABLE_SCHEMA = '库名' AND AUTO_INCREMENT > 1;
清除数据并重置自增为1
SELECT CONCAT('TRUNCATE TABLE ', table_name, ';') AS `query`
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = '库名';
个人公众号,希望您的关注~
发表评论: