Re: Do I just not understand count()? - Mailing list pgsql-general

From Ben
Subject Re: Do I just not understand count()?
Date
Msg-id Pine.LNX.4.30.0204081137340.9115-100000@gilgamesh.eos.SilentMedia.com
Whole thread Raw
In response to Do I just not understand count()?  (Ben <bench@silentmedia.com>)
List pgsql-general
Er, uh, well, because I confused myself with my trivial example. :)

What I should have said was: it's giving me 3 (not 2), and I'm expecting 2
(not 1).

On Mon, 8 Apr 2002, Hunter Hillegas wrote:

> Why would you think it would return 1? the number of rows where a=1 in t is
> 2...
>
>
> > From: Ben <bench@silentmedia.com>
> > Date: Mon, 8 Apr 2002 11:25:43 -0700 (PDT)
> > To: <pgsql-general@postgresql.org>
> > Subject: [GENERAL] Do I just not understand count()?
> >
> > If I have the table t defined as:
> >
> > a
> > ---
> > 1
> > 1
> > 2
> >
> >
> > and I say:
> >
> > select count(a=1) from t;
> >
> > should it give me 1 or 2 as a result? I'm getting 2, and I'd think I
> > should get 1....
>


pgsql-general by date:

Previous
From: "Gregory Wood"
Date:
Subject: Re: Do I just not understand count()?
Next
From: Ben
Date:
Subject: Re: Do I just not understand count()?