Categories:

String & Binary Functions (Matching/Comparison)

STARTSWITH¶

Returns true if expr1 starts with expr2. Both expressions must be text or binary expressions.

Syntax¶

STARTSWITH( <expr1> , <expr2> )
Copy

Collation Details¶

The collation specifications of all input arguments must be compatible.

This function does not support the following collation specifications:

  • lower.

  • upper.

  • pi (punctuation-insensitive).

  • cs-ai (case-sensitive, accent-insensitive).

Examples¶

select * from strings;

---------+
    S    |
---------+
 coffee  |
 ice tea |
 latte   |
 tea     |
 [NULL]  |
---------+

select * from strings where startswith(s, 'te');

-----+
  S  |
-----+
 tea |
-----+
Copy