Re: Do I just not understand count()?

From: Ben <bench(at)silentmedia(dot)com>
To: Hunter Hillegas <lists(at)lastonepicked(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Do I just not understand count()?
Date: 2002-04-08 18:39:41
Message-ID: Pine.LNX.4.30.0204081137340.9115-100000@gilgamesh.eos.SilentMedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)silentmedia(dot)com>
> > Date: Mon, 8 Apr 2002 11:25:43 -0700 (PDT)
> > To: <pgsql-general(at)postgresql(dot)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....
>

Browse pgsql-general by date

  From Date Subject
Next Message Gregory Wood 2002-04-08 18:42:01 Re: Do I just not understand count()?
Previous Message Ben 2002-04-08 18:25:43 Do I just not understand count()?