RIGHT()
RIGHT(string,length)
This function returns the final
length characters from a string. If you
want to extract the beginning of the string instead of the end, use
the LEFT() function. Both are multibyte-safe.
Here is an example:
SELECT RIGHT(soc_sec, 4) FROM students WHERE student_id = '43325146122';
This statement retrieves the last four digits of the student’s Social Security number as an identity verification.