LEFT (T-SQL)
Returns the part of a character string starting at a specified number of characters from the left.Syntax
LEFT(character_expression, integer_expression)Arguments
character_expression
Is an expression of character or binary data. character_expression can be a constant, variable, or column. character_expression must be of a data type that can be implicitly convertible to varchar. Otherwise, use the CAST function to explicitly convert character_expression.
integer_expression
Is a positive whole number. If integer_expression is negative, a null string is returned.
Returns the part of a character string starting at a specified number of characters from the left.Syntax
LEFT(character_expression, integer_expression)Arguments
character_expression
Is an expression of character or binary data. character_expression can be a constant, variable, or column. character_expression must be of a data type that can be implicitly convertible to varchar. Otherwise, use the CAST function to explicitly convert character_expression.
integer_expression
Is a positive whole number. If integer_expression is negative, a null string is returned.
left("",n)
right("",n)