Results 1 to 2 of 2

Thread: Removing middle initials

  1. #1
    Join Date
    May 2009
    Posts
    7

    Removing middle initials

    For this query there are many first and last names with some having middle initials with a '.' at the end.

    Current result:
    Hong, Amy L.
    Jackson, Yuri K.
    Nguyen, Roy


    Desired:
    Amy Hong
    Yuri Jackson
    Roy Nguyen

    How can I achieve this with SQL Plus?
    Thanks.

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,922
    Search for second space in the name using INSTRING function, and use the character position to get substring of name.


    select substr(name,1,instr(name,' ',2))
    from table

Tags for this Thread

Posting Permissions

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