Results 1 to 5 of 5

Thread: Query???

  1. #1
    Join Date
    Jan 2003
    Posts
    21

    Question Unanswered: Query???

    Hi all!!!

    Is there a way to avoid the case sensitive when performing a "... LIKE '%xxx%'...." in a DB2 SQL query??

    Thanks in advance!

    Cheers

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: Query???

    A query against the sample database


    select * from sales where upper(region) like upper('%be%')

    Cheers

    Sathyaram

    Originally posted by rgarcia
    Hi all!!!

    Is there a way to avoid the case sensitive when performing a "... LIKE '%xxx%'...." in a DB2 SQL query??

    Thanks in advance!

    Cheers

  3. #3
    Join Date
    Jan 2003
    Posts
    21

    Re: Query???

    Originally posted by sathyaram_s
    A query against the sample database


    select * from sales where upper(region) like upper('%be%')

    Cheers

    Sathyaram

    Thanks!
    And If for example I have a column in my table with this value: 'VaLue'...
    Is there a function to do the same but with no case sensitive, as somethig like "select * from sales where upper(region) like function('%value%')"???

    Thanks again!!

    cheers

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: Query???

    I'm not very clear on what function('%value%') means ?

    The reason to do upper on both sides of the expression is to eliminate mixed cases to upper case and then compare ...

    Cheers

    Sathyaram

    Originally posted by rgarcia
    Thanks!
    And If for example I have a column in my table with this value: 'VaLue'...
    Is there a function to do the same but with no case sensitive, as somethig like "select * from sales where upper(region) like function('%value%')"???

    Thanks again!!

    cheers

  5. #5
    Join Date
    Jan 2003
    Posts
    21
    Thank you very much!!!
    That worked!!!

    Cheers!!

Posting Permissions

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