Link Search Menu Expand Document


Divides a string based on a specified delimiter into an array of substrings. The string in the specified index is returned, with 1 being the first index. If the string separator is empty, the string is divided into an array of single characters.


SPLIT_PART(<string>, <delimiter>, <index>)

Please note that the order of the arguments is different than the SPLIT function.

Parameter Description
<string> An expression evaluating to a string to be split.
<delimiter> Any character or substring within <string>. If <delimiter> is an empty string '', the <string> will be divided into single characters.
<index> The index from which to return the substring.


	SPLIT_PART('hello#world','#',1) AS res;

Returns: hello

	SPLIT_PART('this|is|my|test', '|', 4 ) AS res;

Returns: test

	SPLIT_PART('hello world', '', 7 ) AS res;

Returns: w