mysql原字段转驼峰命名

### mysql字段转驼峰命名(table_name=表名,table_schema=数据库名)
### 之所以提取前2位转小写是为了应对:ID、YR短字段
select CONCAT(source,' as ',LOWER(SUBSTR(COLUMN_NAME,1,2)),SUBSTR(COLUMN_NAME,3,LENGTH(COLUMN_NAME)),',') as 'result' from 
(
SELECT REPLACE(COLUMN_NAME,'_','') as 'COLUMN_NAME',COLUMN_NAME as 'source' FROM INFORMATION_SCHEMA.Columns WHERE table_name='t_cas_inspect_track' AND table_schema='epim-3'
) t

mysql原字段转驼峰命名_第1张图片

你可能感兴趣的:(mysql,mysql)