SQL 字符串处理
参考文档
常规
小写
lower(string)
支持的引擎:
对应的 Python 操作:
str.lower()
移除首尾空白符
trim(string)
支持的引擎:
对应的 Python 操作:
str.strip()
拼接
array_join(array, sep, null_replacement)
支持的引擎:
对应的 Python 操作:
sep.join(array)
截取
substr(string, start)substr(string, start, length)注意:Positions start with 1
正则
正则替换
regexp_replace(string, pattern, replacement)
正则切分
regexp_split(string, pattern)
正则抽取
regexp_extract(string, pattern)regexp_extract(string, pattern, group)regexp_extract_all(string, pattern)regexp_extract_all(string, pattern, group)
Last updated