RIGHT

Purpose

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

Syntax

right::=

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.
  • For more information, see functions SUBSTR[ING], MID and LEFT.

Example

SELECT RIGHT('abcdef',3) RIGHT_SUBSTR;