split
This function splits a given string according to the separators, and returns the split parts in ARRAY.
Syntaxβ
ARRAY<VARCHAR> split(VARCHAR content, VARCHAR delimiter)
Examplesβ
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"] |
+------------------+
keywordβ
SPLIT