1.将需要执行的sql导出:
SELECT
CONCAT(
'ALTER TABLE ',
table_name,
' MODIFY TYPE VARCHAR(100);'
) AS '呼呼sql'
FROM
information_schema.tables
WHERE table_schema = '数据库名' ;
例如
SELECT
CONCAT(
'update ',
table_name,
' set update_by = create_by and update_time = create_time WHERE update_by is null or update_time is null;'
) AS 'ok'
FROM
information_schema.tables
WHERE table_schema = 'old_gmt';
然后粘贴就行了