This discussion is archived
2 Replies Latest reply: Feb 18, 2013 2:49 AM by Rahul_India RSS

string

974898 Newbie
Currently Being Moderated
Hi all,

I want to get sub string rasheed mohamed from email id rasheed.mohamed@gmail.com

how do i write sql query to get the above output
  • 1. Re: string
    Rahul_India Journeyer
    Currently Being Moderated
    with t as
    (
    select 'rasheed.mohamed@gmail.com' str
    from dual
    )
    select replace(substr(str,1,instr(str,'@',1,1)-1 ),'.',' ')
     name from t
    Edited by: Rahul India on Feb 18, 2013 4:19 PM
  • 2. Re: string
    jeneesh Guru
    Currently Being Moderated
    anees_mohd wrote:
    Hi all,

    I want to get sub string rasheed mohamed from email id rasheed.mohamed@gmail.com

    how do i write sql query to get the above output
    replace(substr(email,1,instr(email,'@')-1),'.',' ')
    
    with t as
    (
    select 'rasheed.mohamed@gmail.com' email 
    from dual
    )
    select email,replace(substr(email,1,instr(email,'@')-1),'.',' ') name
    from t;
    
    EMAIL                     NAME  
    ------------------------- -------
    
    rasheed.mohamed@gmail.com rasheed mohamed 
    Edited by: jeneesh on Feb 18, 2013 4:12 PM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points