Substring/Substr

String Function

Description

Returns the portion of the string or binary value from base_expr, starting from the character/byte specified by start_expr, with optionally limited length.

Click here to navigate to the Postgre docs page for this syntax.

The function Substring() and Substr() are supported on snowflake.

Grammar Syntax

substring(base_expr[from start_expr] [for length])
substr(base_expr[from start_expr] [for length])
substring(base_expr, start_expr, length])

Sample Source Patterns

Postgre

SELECT
    SUBSTRING('substringTest' FROM 3 FOR 2)
FROM
   Table1;

Snowflake

SELECT
    SUBSTRING('substringTest', 3, 2)
FROM
    Table1;

Last updated