LEFT() FUNCTION
The MySQL LEFT function is used to extract a substring from a string. It starts the extraction from the left-most character. The various versions of MySQL supports the LEFT function, namely, MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0, MySQL 4.1, MySQL 4.0 and MySQL 3.23.
Syntax:
LEFT( string, number_of_characters )
Parameters:
Example:
mysql> SELECT LEFT ( 'HELLO WORLD', 5); |
Output:
'HELLO’ |
Explanation:
The first five characters are extracted from the left-most position of the string.
Please Share