LEFT

Purpose

This function returns the left-aligned substring of string with length length.

Syntax

left::=

Usage Notes

  • If either length or string is NULL, then NULL is returned.
  • Also if length is greater than the length of string, the original string is returned. If length is negative or 0, then NULL is returned.
  • Additionally, refer to functions SUBSTR[ING], MID and RIGHT for more information.

Example

SELECT LEFT('abcdef',3) LEFT_SUBSTR;