mysql批量修改列名,大写列名到小写
SELECT
concat( 'ALTER TABLE `database_name`.`', TABLE_NAME, '` CHANGE COLUMN `', COLUMN_NAME, '` `', LOWER( COLUMN_NAME ), '` ', COLUMN_TYPE, ' comment ''', COLUMN_COMMENT, ''';' ) AS '修改脚本'
FROM
information_schema.COLUMNS
WHERE
TABLE_SCHEMA = 'database_name'
替换图中database_name即可。
主要依据information_schema.COLUMNS这张表,具体可执行以下语句查看
SELECT * FROM information_schema.COLUMNS