RIGHT

Returns the specified characters from the right side of a string.

Behavior Type

Immutable

Syntax

RIGHT ( string , length )

Parameters

string

(CHAR or VARCHAR) is the string to return.

length

Is an INTEGER value that specifies the count of characters to return.

Examples

The following command returns the last three characters of the string 'vertica':

=> SELECT RIGHT('vertica', 3);
 RIGHT
-------
 ica
(1 row)

The following command returns the last two characters of the string 'straße':

=> SELECT RIGHT('straße', 2);
 RIGHT
-------
 ße
(1 row)

See Also