就结合instr与substr两个函数,判断/符号的位置。

解决方案 »

  1.   

    SQL> select * from t1;TEL
    --------------------------------------------------------------------------------1234/777/123456789
    SQL> set serveroutput on
    SQL> declare
      2  total number;
      3  tele varchar2(100);
      4  begin
      5  select length(tel)-length(replace(tel,'/'))+1 into total from t1;
      6  for i in 1..total loop
      7  select replace(substr('/'||tel||'/',instr('/'||tel||'/','/',1,i),instr('/'|
    |tel||'/','/',1,i+1)-instr('/'||tel||'/','/',1,i)),'/')
      8  into tele
      9  from t1;
     10  dbms_output.put_line(tele);
     11  end loop;
     12  end;
     13  /
    1234
    777
    123456789PL/SQL procedure successfully completed.
      

  2.   

    看看这篇文章,肯定对你会有帮助的!http://blog.csdn.net/huangyunzeng2008/archive/2010/01/08/5157263.aspx