用途就是把array
中的每个元素用分隔符连接起来
array_join(x, delimiter, null_replacement) → varchar
Concatenates the elements of the given array using the delimiter and an optional string to replace nulls.
案例
如下regexp_extract_all
提取字符串,返回值为array
,之后用,
把 array中的元素连接起来
> select array_join(regexp_extract_all('1a 2b 14m', '\d+'),',', 'none');
_col0
--------
1,2,14
总结
array_join
就是把数组中的元素用特定分隔符
连接成字符串