SELECT
CONCAT(
'ALTER TABLE ',
table_name,
' RENAME TO te_',
substring(table_name, 4),
';'
)
FROM
information_schema. TABLES
WHERE
table_schema = 'testadmin'
AND table_name LIKE 'hp_%';
mysql批量修改表前缀
最新推荐文章于 2023-06-16 09:31:48 发布
SELECT
CONCAT(
'ALTER TABLE ',
table_name,
' RENAME TO te_',
substring(table_name, 4),
';'
)
FROM
information_schema. TABLES
WHERE
table_schema = 'testadmin'
AND table_name LIKE 'hp_%';