- SPLIT_PART
SPLIT_PART() 函数通过指定分隔符分割字符串,并返回第N个子串。语法:
SPLIT_PART(string, delimiter, position)
SELECT SPLIT_PART(‘A,B,C’, ‘,’, 2); – 返回B
2.STRING_TO_ARRAY
该函数用于分割字符串至数组元素,请看语法:
string_to_array(string, delimiter [, null string])
SELECT string_to_array(‘xx^yy^zz’, ‘^’); – {xx,yy,zz}
SELECT string_to_array(‘xx^yy^zz’, ‘^’, ‘yy’); – {xx,zz}