我有一张雪花table,看起来像这样:
--------------------
| fieldname |
--------------------
|thisIsTestOne |
|thisIsTestTwo |
|this_test |
--------------------
我需要将列中的pascalcase值转换为大小写。注意:如果它们是pascalcase,我只想把它们转换成snake\u case。输出应该是这样的;
-------------------- ---------------------
| fieldname | newfieldname |
-------------------- ---------------------
|thisIsTestOne |this_is_test_one |
|thisIsTestTwo |this_is_test_two |
|this_test |this_test |
-------------------- ---------------------
1条答案
按热度按时间brvekthn1#
你应该可以使用
REGEXP_REPLACE
在小写字符和大写字符之间插入下划线,然后LOWER
转换成小写,即。