ENDSWITH

functionsupportedCore SQL functions

docs.snowflake.com ↗

String & binary functions

Returns TRUE if the first expression ends with the second expression. Both expressions must be text or binary expressions. Tip You can use the search optimization service to improve the performance of queries that call this function. For details, see Search optimization service.

Syntax

ENDSWITH( <expr1> , <expr2> )

Parameters

NameRequiredDescription
expr1requiredThe string to search in.
expr2requiredThe string to search for at the end of expr1.

Returns

Returns a BOOLEAN or NULL: - Returns TRUE if expr2 ends with expr1. - Returns FALSE if expr2 does not end with expr1. - Returns NULL if either input expression is NULL.

Collation details

The collation specifications of all input arguments must be compatible. This function does not support the following collation specifications: - pi (punctuation-insensitive). - cs-ai (case-sensitive, accent-insensitive).