Skip to main content

RIGHT

Returns the rightmost len characters from the string str, or NULL if any argument is NULL.

Syntax

RIGHT(str,len);

Arguments

ArgumentsDescription
strThe main string from where the character to be extracted
lenThe count of characters

Return Type

String data type value.

Examples

SELECT RIGHT('foobarbar', 4);
+-----------------------+
| RIGHT('foobarbar', 4) |
+-----------------------+
| rbar |
+-----------------------+