Results 1 to 2 of 2
  1. #1
    Join Date
    May 2008
    Posts
    97

    Unanswered: Quick/Simple Question about strings.

    Lets say I have the following table
    Code:
    SQL> select Serial from s2.saleinv;
    
    SERIAL
    --------
    M08YSLR0
    A07RCSX1
    A07RRSX1
    J07BXJR1
    M08SSLK0
    M08SGCS1
    M08BCOM3
    J20B1238
    A96WRSX3
    M05BLX0
    J08XL1
    
    SERIAL
    --------
    J06BXKR3
    M06BSLR1
    H05PM349
    A06GTSX1
    A06RING1
    and I want to select everything from the table in this pattern ''J+++XJR+" .. and the plus signifies ANY SINGLE character.

    I tried

    Code:
     
    SQL> select * from s2.saleinv where serial = 'J___XJR_';
    
    no rows selected
    Which should select (or so I thought it should select) the serial entry 'J07BXJR1' but... nothing gets selected why??

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >nothing gets selected why??
    You are requesting exact match -> serial = 'J___XJR_'
    as opposed to wildcard -> serial LIKE 'J___XJR_'
    Last edited by anacedent; 06-12-08 at 23:06.
    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.

Posting Permissions

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