Translation specification for the SUBSTRING/SUBSTR functions to their Snowflake equivalents
Last updated 1 year ago
Extracts a substring from a given input string. For more information check
SUBSTRING(string_expr FROM n1 [FOR n2]) SUBSTR(string_expr, n1, [, n2])
When the value to start getting the substring (n1) is less than one SUBSTR_UDF is inserted instead.
SELECT SUBSTR('Hello World!', 2, 6), SUBSTR('Hello World!', -2, 6), SUBSTRING('Hello World!' FROM 2 FOR 6), SUBSTRING('Hello World!' FROM -2 FOR 6);
COLUMN1 |COLUMN2 |COLUMN3 | COLUMN4 | --------+--------+--------+---------+ ello W |Hel |ello W |Hel |
SELECT SUBSTR('Hello World!', 2, 6), PUBLIC.SUBSTR_UDF('Hello World!', -2, 6), SUBSTRING('Hello World!', 2, 6), PUBLIC.SUBSTR_UDF('Hello World!', -2, 6);
No related EWIs.