SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Get my greedy down dotJoon's Avatar
    Join Date
    Apr 2003
    Location
    daejeon, South Korea
    Posts
    2,211
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    only after the first delimeter

    1111_2222_3333
    I have a value which has delimiters(_) like the above.

    I like to get the value which is after the first delimeter.

    One of my trial code below for it produces the result below.
    Code:
    trial code
    
    substring_index(mystring,'_',-1)
    
    result
    
    3333
    
    target result
    
    2222_3333

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,408
    Mentioned
    149 Post(s)
    Tagged
    4 Thread(s)

  3. #3
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,021
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    SUBSTRING(mystring FROM POSITION('_' IN mystring)+1)

    basic string functions

    learn your functions, joon, they are all very nicely defined in the manual
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

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