Re: Do I just not understand count()?

Поиск
Список
Период
Сортировка
От Ben
Тема Re: Do I just not understand count()?
Дата
Msg-id Pine.LNX.4.30.0204081137340.9115-100000@gilgamesh.eos.SilentMedia.com
обсуждение исходный текст
Ответ на Do I just not understand count()?  (Ben <bench@silentmedia.com>)
Список 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 по дате отправления:

Предыдущее
От: "Gregory Wood"
Дата:
Сообщение: Re: Do I just not understand count()?
Следующее
От: Ben
Дата:
Сообщение: Re: Do I just not understand count()?