mysql没有直接处理的函数,需要先自定义一个函数运行函数:
CREATE FUNCTION underlineToCamel
(paramString VARCHAR(200)) RETURNS varchar(200) CHARSET utf8
DETERMINISTIC
begin
set paramString = LOWER(paramString);
set paramString = replace(paramString, ‘_a’, ‘A’);
set paramString = replace(paramString, ‘_b’, ‘B’);
set paramString = replace(paramString, ‘_c’, ‘C’);
set paramString = replace(paramString, ‘_d’, ‘D’);
set paramString = replace(paramString, ‘_e’, ‘E’);
set paramString = replace(paramString, ‘_f’, ‘F’);
set paramString = replace(paramString, ‘_g’, ‘G’);
set paramString = replace(paramString, ‘_h’, ‘H’);
set paramString = replace(paramString, ‘_i’, ‘I’);
set paramString = replace(paramString, ‘_j’, ‘J’);
set paramString = replace(paramString, ‘_k’, ‘K’);
set paramString = replace(paramString, ‘_l’, ‘L’);
set paramString =
Mysql 自定义函数-下划线转驼峰
最新推荐文章于 2024-05-24 13:48:02 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)