Função String RIGHT(str,num) no Banco de Dados
Pega os últimos num caracteres da str
mysql> SELECT RIGHT('foobarbar', 4);
        -> 'rbar'