mysql 批量修改表列明为大小写
作者:互联网
根据表名 修改为小写
SELECT concat( 'alter table ', TABLE_NAME, ' change column ', COLUMN_NAME, ' ', LOWER( COLUMN_NAME ), ' ', COLUMN_TYPE, ' comment \'', COLUMN_COMMENT, '\';' ) AS '修改脚本' FROM information_schema.COLUMNS WHERE TABLE_NAME = '表名';
根据库名 修改为小写
SELECT concat( 'alter table ', TABLE_NAME, ' change column ', COLUMN_NAME, ' ', LOWER( COLUMN_NAME ), ' ', COLUMN_TYPE, ' comment \'', COLUMN_COMMENT, '\';' ) AS '修改脚本' FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '数据库名'
大写的话 把 LOWER 改成 UCASE
标签:comment,LOWER,NAME,COLUMN,表列,修改,大小写,mysql,TABLE 来源: https://www.cnblogs.com/yangjinwang/p/14136970.html