Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2014
    Posts
    7

    Unanswered: Help with sql for DB2

    Hi

    I am writing a sql to find all UPS tracking id in a table. The sql works but I do not know how to state in my sql to look for all TRACKINGID begining with 1z and 1Z.

    If I state the following it works perfect;
    and CARRIER = 'UPS'
    and TRACKINGID like ('1z%')

    however some UPS tracking id starts with 1Z (ie with an uppercase Z) which I do not know how to add that in one statement.

    If I state the following I get an error;
    and CARRIER = 'UPS'
    and TRACKINGID like ('1z%' , '1Z%').

    Please can anyone assist.

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Without seeing your CREATE TABLE, the best workaround I can give you is:
    Code:
    and CARRIER = 'UPS'
     and TRACKINGID like ('1[zZ]%')
    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  3. #3
    Join Date
    Jan 2014
    Posts
    7

    I appreciate your help

    You have been very helpful PatP.
    It worked perfect!

    That was my first post and I'm quite a novice in SQL but I'll
    Take heed to your advice and attach the entire SQL next time.

    Regards.
    Ph1

Posting Permissions

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