SELECT CONCAT( 'ALTER TABLE ', table_name, ' RENAME TO yc_', substring(table_name, 5), ';' ) sqlsFROM information_schema.tables Where table_name LIKE 'lm_%';
博客列表 >mysql批量更新表名的前缀
SELECT CONCAT( 'ALTER TABLE ', table_name, ' RENAME TO yc_', substring(table_name, 5), ';' ) sqlsFROM information_schema.tables Where table_name LIKE 'lm_%';