Firebird Documentation Index → Firebird 2.1 Language Ref. Update → Internal functions → LEFT() |

Available in: DSQL, PSQL

Added in: 2.1

Description: Returns the leftmost part of the argument string. The number of characters is given in the second argument.

Result type: VARCHAR or BLOB

Syntax:

LEFT (,`string`

)`length`

This function fully supports text BLOBs of any length, including those with a multi-byte character set.

If

is a BLOB, the result is a BLOB. Otherwise, the result is a VARCHAR(`string`

) with`n`

the length of the input string.`n`

If the

argument exceeds the string length, the input string is returned unchanged.`length`

If the

argument is not a whole number, bankers' rounding (round-to-even) is applied, i.e. 0.5 becomes 0, 1.5 becomes 2, 2.5 becomes 2, 3.5 becomes 4, etc.`length`

See also: RIGHT()

Firebird Documentation Index → Firebird 2.1 Language Ref. Update → Internal functions → LEFT() |