1:原始sql
select GROUP_CONCAT(REPLACE(REPLACE(na,'_',''),LEFT(na,1),LOWER(LEFT(na,1)))) as col from (
select REPLACE(aaa.name,left(SUBSTRING_INDEX(aaa.name,'_',-1),1), UCASE(left(SUBSTRING_INDEX(aaa.name,'_',-1),1)) ) as na
from(
select `column_name` as name from information_schema.`COLUMNS` where table_name =(表的名称)) aaa) ttt;
2:可封装函数或是存储过程,或者封装在orm框架中使用;
3:以上sql没有经过优化,如果有更好的sql实现,欢迎留言交流;