Splits a string into an array based on a delimiter. Very useful for parsing CSV-style data.
ARRAY<STRING>Diperbarui: 13 Jun 2026SPLIT(value [, delimiter])The string to split
The separator character (default: comma ',')
1 SELECT SPLIT('a,b,c') as result;
Splits a string on commas.
1 SELECT 2 id, 3 SPLIT(tags, ',') as tag_array, 4 ARRAY_LENGTH(SPLIT(tags, ',')) as tag_count 5 FROM `project.dataset.posts`;
Parses a comma-separated tags column.
| id | tag_array | tag_count |
|---|---|---|
| 1 | ["tech", "ai", "ml"] | 3 |
| 2 | ["business", "startup"] | 2 |
1 SELECT 2 email, 3 SPLIT(email, '@')[OFFSET(0)] as username, 4 SPLIT(email, '@')[OFFSET(1)] as domain 5 FROM `project.dataset.users`;
Accesses individual elements from the split result.
| username | domain | |
|---|---|---|
| john@gmail.com | john | gmail.com |
1 SELECT 2 file_path, 3 ARRAY_REVERSE(SPLIT(file_path, '/'))[OFFSET(0)] as file_name 4 FROM `project.dataset.files`;
Extracts the filename from a file path.
| file_path | file_name |
|---|---|
| /home/user/docs/file.txt | file.txt |
Sudah paham SPLIT? Latih langsung di browser
Latihan interaktif, langsung di browser.