Chapter 4: SQL Language Elements
4.9.2.66 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 of the type fixed or variable length CHARACTER.
- 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.