Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2013
    Posts
    8

    Unanswered: Extract user name in mail

    Hi,

    I have mail id in a column. i just need to extract only name in that mail id.
    for example tomas@gmail.com
    the output should be tomas

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    use INSTR & SUBSTR functions
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Feb 2006
    Posts
    173
    Provided Answers: 1
    Quote Originally Posted by simius View Post
    extract only name in that mail id.
    for example tomas@gmail.com
    the output should be tomas
    If you want everything before the '@', You can also try this:
    Code:
    select regexp_substr('tomas@gmail.com','(.+)@',1,1,'i',1) as result
     from  dual
    RESULT
    --------------------------------
    tomas

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    ... which, unless I'm wrong, won't work in any Oracle version lower than 11g.

Posting Permissions

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