Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 811 Bytes

File metadata and controls

44 lines (33 loc) · 811 Bytes

split

功能

根据分隔符拆分字符串, 将拆分后的所有字符串以 ARRAY 的格式返回

语法

split(content, delimiter)

参数说明

content: 支持的数据类型为 VARCHAR

delimiter: 支持的数据类型为 VARCHAR

返回值说明

返回值的数据类型为 ARRAY

示例

mysql> select split("a,b,c",",");
+---------------------+
| split('a,b,c', ',') |
+---------------------+
| ["a","b","c"]       |
+---------------------+
mysql> select split("a,b,c",",b,");
+-----------------------+
| split('a,b,c', ',b,') |
+-----------------------+
| ["a","c"]             |
+-----------------------+
mysql> select split("abc","");
+------------------+
| split('abc', '') |
+------------------+
| ["a","b","c"]    |
+------------------+