日期:2014-05-17 浏览次数:20751 次
select substr(id, 1,length(id)-4) as id from test;
------解决方案--------------------
select substr(id,length(id)-4+1) as id
from test;
------解决方案--------------------
select substr(c1,length(c1)-4+1) from t1
------解决方案--------------------
SQL> with tmp as ( 2 select '12345' data from dual union all 3 select '1' data from dual union all 4 select '123' data from dual 5 ) 6 select substr(data, -least(length(data), 4)) 7 from tmp; SUBSTR(DATA,-LEAST(LENGTH(DATA ------------------------------ 2345 1 123