sql question regarding count(*)

From: Rajesh Kumar Mallah <mallah(at)trade-india(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: sql question regarding count(*)
Date: 2003-03-06 11:32:26
Message-ID: 200303061702.26339.mallah@trade-india.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


When does count(*) returns "o rows" ?
and when does it return 1 row value being 0.

tradein_clients=# SELECT count(*) from public.eyp_listing where sno> 0 and
amount> 0 group by sno,branch,edition having count(distinct userid) > 1 ;
count
-------
(0 rows)

tradein_clients=#
tradein_clients=#
tradein_clients=# SELECT count(*) from public.users where userid=-1;
count
-------
0
(1 row)

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.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tomasz Myrta 2003-03-06 12:00:52 Re: sql question regarding count(*)
Previous Message Priya, Nagappan (N.) 2003-03-06 09:53:53 decode or case statements