mysql批量修改表前缀

warning: 这篇文章距离上次修改已过332天,其中的内容可能已经有所变动。

修改表名

SELECT
CONCAT(
    'ALTER TABLE ',
    table_name,
    ' RENAME TO b_',
    substring( table_name, 2 ),
    ';' 
) 
FROM
information_schema.TABLES 
WHERE
table_name LIKE 'a_%';
最后修改于:2023年06月23日 11:29

添加新评论