SPLIT_PART

Description

Splits a string on the specified delimiter and returns the part at the specified position.. (SQL Language References SPLIT_PART function).

Grammar Syntax

SPLIT_PART(string, delimiter, position)

This function is fully supported by Snowflake.

Sample Source Patterns

Input Code:

IN -> Redshift_01.sql
select split_part('abc$def$ghi','$',2) AS split_1,
split_part('abc$def$ghi','$',4) AS split_2,
split_part('abc$def$ghi','#',1) AS split_3;

Output Code:

OUT -> Redshift_01.sql
select split_part('abc$def$ghi','$',2) AS split_1,
split_part('abc$def$ghi','$',4) AS split_2,
split_part('abc$def$ghi','#',1) AS split_3;

Know Issues

There is a difference in how SPLIT_PART behaves when used with case-insensitive collations (CASE_INSENSITIVE or en-ci) in Snowflake vs. Redshift.

There are no known issues.

Last updated