SQL LEFT() is used for extracting a substring starting from the left, followed by the number of characters. SQL LEFT() function extracts several characters from the string (starting from left).

SQL Left Function

SQL LEFT() function extracts a given number of characters from the left side of a supplied string.

The syntax of the LEFT() function is as follows.

SELECT LEFT (string, no_of_characters);

See the following parameters.

PARAMETERS:
  1. String: An input string from which the substring will be extracted and can be a literal string, variable or a column.
  2. No_of_characters: Number of characters you wish to extract from the string.

The LEFT() function returns a value of VARCHAR when the input_string is non-Unicode character data type and returns an NVARCHAR if the input_string is a Unicode character data type.

#sql #sql left #mysql #sql server

SQL Left Function Example | LEFT() In SQL Server And MySQL
9.25 GEEK