日期:2014-05-17  浏览次数:20817 次

Oracle數字求右5位
"5000123456"
Oracle如何求這個數字的右5位--"23456"

------解决方案--------------------
SQL code
SQL> SELECT SUBSTR('5000123456',LENGTH('5000123456')-4) "STR"
  2    FROM DUAL;

STR
-----
23456

------解决方案--------------------
SQL code
OPER@tl>select substr('5000123456',-5) from dual;

SUBSTR('50
----------
23456

OPER@tl>