Description
The RIGHT( ) function returns the rightmost len characters from the string (str). It returns NULL, if any argument is NULL.
This function has the form:
SELECT RIGHT(str, len)
Parameter | Description |
---|---|
str | String |
len | Length |
Return Value
The rightmost len characters from the string (str). It returns NULL, if any argument is NULL.
Examples
The following example shows the basic use of this function:
mysql> SELECT RIGHT('foobarbar', 4);
-> 'rbar'