日期:2014-05-17 浏览次数:20977 次
--举例如下,你的表自已替换下就可以了 select replace(regexp_substr('gaga/gaga/aa','/[[:alpha:]]*$'),'/','') from dual;
------解决方案--------------------
select substr('dfa/gads/ga/ga', instr('dfa/gads/ga/ga', '/', -1) + 1) from dual;
------解决方案--------------------
--方法1: SQL> with tmp as 2 ( 3 select 'gaga/gaga/aa' name from dual union all 4 select 'fa/gda' name from dual union all 5 select 'dfa/gads/ga/ga' name from dual 6 ) 7 select replace(regexp_substr(name,'/[[:alpha:]]*$'),'/','') name from tmp; NAME ---------------------------- aa gda ga --方法2: SQL> with tmp as 2 ( 3 select 'gaga/gaga/aa' name from dual union all 4 select 'fa/gda' name from dual union all 5 select 'dfa/gads/ga/ga' name from dual 6 ) 7 select substr(name, instr(name, '/', -1) + 1) name from tmp; NAME ---------------------------- aa gda ga