Back to Starrocks

left

docs/en/sql-reference/sql-functions/string-functions/left.md

4.1.0496 B
Original Source

left

This function returns a specified number of characters from the left side of a given string. The unit for length: utf8 character. Note: This function is also named as strleft.

Syntax

SQL
VARCHAR left(VARCHAR str,INT len)

Examples

SQL
MySQL > select left("Hello starrocks",5);
+----------------------------+
| left('Hello starrocks', 5) |
+----------------------------+
| Hello                      |
+----------------------------+

keyword

LEFT