Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Queries give impossible results

Re: Queries give impossible results

From: Jusung Yang <JusungYang_at_yahoo.com>
Date: 15 Nov 2002 01:21:44 -0800
Message-ID: <130ba93a.0211150121.5d7732e2@posting.google.com>


Maybe by now you have figured out what is going with your data and that ORACLE, after all, did not give you wrong results. I don't think ORACLE is capable of giving wrong results for simple queries like these.

> Using common sense it's easy to understand that there are more
> than 4 customers that are not 'PERSON' but are 'ACTIVE'.

I failed to see how this is common sense. Did I misunderstand you or did you come to this conclusion :

           count( customer_state = 'ACTIVE and customer_type <> 'PERSON')
   must be much larger than 4 because both these counts are so high

           count(customer_state = 'ACTIVE) : 135324
           count(customer_type <> 'PERSON') : 138292
?

(123450000444555666667890123456780xxxx)                                 

(xxxxabcdefghijklmmmmmmmnnnoppppptyuuuuu)

The two groups above can each have many, many members. But there may be only a few members (the xxxx) that belong to both groups ( the "and" operator in your case).

You can even try a count on the "or"

         count( customer_state = 'ACTIVE' or customer_type <> 'PERSON')
The result should be 135324 + 138292 - 4. This will be true regardless whether or not there are NULLs in the table.

Received on Fri Nov 15 2002 - 03:21:44 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US