LEFT function [String]

Function

Returns a specified number of characters from the beginning of a string.

Syntax

LEFT ( string-expression, numeric-expression )

Parameters

string-expression The string.

numeric-expression The number of characters to return.

Example

The following statement returns the value choco.

SELECT LEFT( 'chocolate', 5 ) FROM iq_dummy

Usage

If the string contains multibyte characters, and the proper collation is being used, the number of bytes returned may be greater than the specified number of characters.

Standards and compatibility

See also

“RIGHT function [String]”

Chapter 11, “International Languages and Character Sets” in the Sybase IQ System Administration Guide