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: Strange SQL Results

Re: Strange SQL Results

From: Christopher M. Day <christopher.day_at_rdbms.freeserve.co.uk>
Date: Sun, 11 Apr 1999 20:43:03 +0100
Message-ID: <3710FB47.4812A21B@rdbms.freeserve.co.uk>


Phillipaa,

Check that you have patched to 8.0.5.11 or higher if you have bitmap indexes on the date fields.

Chris

Phillippa Verity Davies wrote:
>
> I would like to understand why I am getting the following results, it seems
> like a possible problem in the database engine to me, but if some one can
> explain it great! It is happening on Oracle 8, though I have no idea of the
> fix level of the product.
>
> I have a large table with at least 3 date fields all of which allow nulls, I
> am just counting the rows that match certain criteria.
>
> SELECT COUNT(*) WHERE DateA>TODATE('01-01-1998')
> returns approx. 20K
> SELECT COUNT(*) WHERE DateA>TODATE('01-01-1998') OR
> DateB>TODATE('01-01-1998')
> returns approx. 50K
> SELECT COUNT(*) WHERE DateA>TODATE('01-01-1998') OR
> DateB>TODATE('01-01-1998') OR DateC>TODATE('01-01-1998')
> Returns approx. 30K
>
> I am surprised that an additional OR condition could reduce the number of
> rows.
Received on Sun Apr 11 1999 - 14:43:03 CDT

Original text of this message

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