Left Function In Sql in SQL
LEFT Function in SQL
The LEFT function returns the leftmost specified number of characters from a string.
Syntax:
LEFT(string, number_of_characters)string: The source string.number_of_characters: The number of characters to return from the left side.
Example:
SELECT LEFT('Hello World', 5) AS left_part;Result:
| left_part |
|---|
| Hello |
Notes:
Useful for extracting a substring from the beginning of a string.
Supported in MySQL, SQL Server, and others.
In Oracle, similar functionality can be done with
SUBSTR(string, 1, number_of_characters).
If you want, I can show examples for other string functions!