mysql批量修改列类型-生成语句
SELECT CONCAT( 'alter table ', table_name, ' MODIFY COLUMN ', column_name, ' float DEFAULT NULL;' ) AS col, TABLE_NAME, COLUMN_NAME, DATA_TYPE FROM INFORMATION_SCHEMA.columns a WHERE TABLE_SCHEMA = 'prod_db' -- 代表所在的数据库 AND data_type IN ('double') -- 批量修改的类型