Results 1 to 5 of 5
  1. #1
    Join Date
    May 2004
    Posts
    144

    Unanswered: SELECT fields with igoring zero before strings

    hi
    i want to write a select query which ignore zeros before the string.
    for example if fld1='007Sh980', my query must return '7Sh980'.
    anyone can help?

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    EDIT: Actually, this is wrong, so ignore it
    George
    Home | Blog

  3. #3
    Join Date
    May 2004
    Posts
    144
    is it possible with mysql function? if it is, plz recommend best func for this

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    SELECT TRIM(LEADING '0' FROM fld1) as trimmed_fld1 ...
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Nov 2006
    Location
    Quebec
    Posts
    172
    Wow interesting I didn't know that use of TRIM.
    Thank you, I'll use that functionality for sure!
    Less is more.
    How long is now?
    http://www.lesouterrain.com

Posting Permissions

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