DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: how to find first occurence of character ina string

Threaded View

  1. #2
    Join Date
    Jan 2001
    Posts
    2,828
    Hi

    You need to use instr and substr functions

    select substr('123-23-3456',1,INSTR('123-23-3456','-',1,1)-1) from dual;

    select substr('123-23-3456',INSTR('123-23-3456','-',1,1)+1,
    INSTR('123-23-3456','-',-2,1)-INSTR('123-23-3456','-',1,1)-1)
    from dual

    and so on

    regards
    Hrishy
    Last edited by hrishy; 06-16-2006 at 08:10 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width