From: Rajesh Kumar Mallah <mallah@trade-india.com>
To: Stephan Szabo <sszabo@megazone23.bigpanda.com>
Cc: Tomasz Myrta <jasiek@klaster.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: sql question regarding count(*)
Date: Fri, 7 Mar 2003 12:01:38 +0530
Message-ID: <200303071201.38192.mallah@trade-india.com> (raw)
In-Reply-To: <20030306220603.P87448-100000@megazone23.bigpanda.com>
References: <20030306220603.P87448-100000@megazone23.bigpanda.com>
On Friday 07 March 2003 11:41 am, Stephan Szabo wrote:
> On Fri, 7 Mar 2003, Rajesh Kumar Mallah wrote:
> > Tomasz did you notice the two queries are totally differet on different
> > tables?
>
> A count() on a non-grouped table returns 1 row.
>
> A grouped table returns 1 row per group. If there are no groups, no rows
> are returned. If the groups are filtered by a having clause, it might
> also return no rows.
True the second query does not return any row.
even in first case no rows are returned.
where is the difference?
tradein_clients=# select userid from users where userid=-1;
+--------+
| userid |
+--------+
+--------+
(0 rows)
Time: 846.86 ms
tradein_clients=#
Regds
Mallah
----------------------------------------
Rajesh Kumar Mallah,
Project Manager (Development)
Infocom Network Limited, New Delhi
phone: +91(11)6152172 (221) (L) ,9811255597 (M)
Visit http://www.trade-india.com ,
India's Leading B2B eMarketplace.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: mallah@trade-india.com, sszabo@megazone23.bigpanda.com, jasiek@klaster.net
Subject: Re: sql question regarding count(*)
In-Reply-To: <200303071201.38192.mallah@trade-india.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox