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

From Nigel J. Andrews
Subject Re: Do I just not understand count()?
Date
Msg-id Pine.LNX.4.21.0204082003050.2690-100000@ponder.fairway2k.co.uk
Whole thread Raw
In response to Re: Do I just not understand count()?  ("Gregory Wood" <gregw@com-stock.com>)
Responses Re: Do I just not understand count()?
List pgsql-general

Perhaps it would clear up things for those more expert on SQL [and it's
variations across DBs] than I if you could say on what system you would
normally do this.


> > That's what I'd normally do to, but in this case I want to run a query
> > more like
> >
> > select count(a=1), count(a=2) from t
> >
> > > > 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....
> > > >



--
Nigel J. Andrews
Director

---
Logictree Systems Limited
Computer Consultants



pgsql-general by date:

Previous
From: "Jim Ballard"
Date:
Subject: Re: Do I just not understand count()
Next
From: "David Esposito"
Date:
Subject: Re: vacuuming not working?