How to get rightmost 10 places of a string in oracle

Viewed 112918

I am trying to fetch an id from an oracle table. It's something like TN0001234567890345. What I want is to sort the values according to the right most 10 positions (e.g. 4567890345). I am using Oracle 11g. Is there any function to cut the rightmost 10 places in Oracle SQL ?

Thanks in advance

tismon

5 Answers
SQL> SELECT SUBSTR('00000000123456789', -10) FROM DUAL;

Result: 0123456789

Related