Product Documentation

SQL Reference Guide

Previous Topic

Next Topic

RIGHT function (ODBC compatible)

Syntax

RIGHT ( string_exp, count )

Description

The scalar function RIGHT returns the rightmost count of characters of string_exp.

Example

SELECT RIGHT(fld1,6)

FROM test100

WHERE fld1 = 'Afghanistan';

RIGHT(FLD1,6)

nistan

1 record selected

Notes

  • The string_exp can be any of the fixed or variable length Character types.
  • The count can be of the type INTEGER, SMALLINT, BIGINT, or TINYINT.
  • If any of the arguments of the expression evaluates to a null, the result would be null.
  • If the count is negative, the result evaluates to a null.

TOCIndex