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: wrong results from "Select count(*) from tbl"

Re: wrong results from "Select count(*) from tbl"

From: Joseph Weinstein <joe.remove_this_at_bea.com.remove_this>
Date: Thu, 17 Jul 2003 08:47:08 -0700
Message-ID: <3F16C4FC.1D8FDE42@bea.com.remove_this>

"OakRogbak_erPine_at_yahoo.com Kill the 2 trees in email address to reply" wrote:

> Hmmm. I bank at Bank of America. How come by account balance isn't
> twice what it should be?

It may just be that BofA thinks there's two of you... ;-)

>
>
> john.muller_at_bankofamerica.com (John Muller) wrote in message news:<270abe86.0307161054.3d162072_at_posting.google.com>...
> > I am the user of an Oracle DB and I am getting what
> > look like wrong counts using "Select count(*)" statments.
> >
> > It first occurred when I tried to get monthly record counts with
> > Select count(*), month
> > from tbl
> > group by month
> > All the monthly counts but one looked like it was 2x what it should be.
> >
> > Oddly enough if I tried
> > Select count(*), month
> > from tbl
> > where month = 200302
> > group by month
> > OR
> > Select count(*), month
> > from tbl
> > where month in (200301 200302)
> > group by month
> > I got what looked correct.
> >
> > I even got the 2X problem when I asked for a count on
> > the entire table using
> > Select count(*)
> > from tbl
> >
> > One of our DBAs suggested the problem has somehting to do with
> > the indexes and not running analyze on the table recently.
> > I'll note also that the table is partitioned.
> >
> > I think it's Oracle version 8.x running on a Sun box.
> >
> > Has anyone seen this before or does anyone have any
> > suggestions on the cause of the problem.
> >
> > Thanks,
> >
> > - john
Received on Thu Jul 17 2003 - 10:47:08 CDT

Original text of this message

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