Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2002
    Posts
    456

    Arrow Unanswered: Id = 10 Or/and Id = 20

    Couple of questions:
    1.)
    Does DB2 evaluate the second expression if first one evaluates to true for expression involving OR?

    2.)
    Does DB2 still checks for second expression if first one evaluates to false in AND condition?

    dollar

  2. #2
    Join Date
    Oct 2001
    Location
    Bangalore
    Posts
    186
    Hi,

    >>Does DB2 evaluate the second expression if first one evaluates to true for expression involving OR?

    Yes it does evaluate the second expression if first one evaluates to true for expression involving OR.

    >>Does DB2 still checks for second expression if first one evaluates to false in AND condition?

    Yes it checks both even if first returns false in AND operation.
    Prashant

  3. #3
    Join Date
    Sep 2002
    Posts
    456
    Thanks Dahalkar,

    Can you point me to the reference material where you found this concept, we are working on imporving the query performance in our company so a concrete proof is required...

    Thanks

    dollar

    Originally posted by dahalkar_p
    Hi,

    >>Does DB2 evaluate the second expression if first one evaluates to true for expression involving OR?

    Yes it does evaluate the second expression if first one evaluates to true for expression involving OR.

    >>Does DB2 still checks for second expression if first one evaluates to false in AND condition?

    Yes it checks both even if first returns false in AND operation.

  4. #4
    Join Date
    Oct 2001
    Location
    Bangalore
    Posts
    186
    Hi Dollar,

    Sorry to say that i have not gone through any reference material.

    But this is a practical experience, just fire a query of that sort and you will get the solution.

    Anyway if i get some reference material , i will let you know

    Cheers,
    Prashant

Posting Permissions

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