Skip site navigation (1) Skip section navigation (2)

count(1) return 0?

From: Zak McGregor <zak(at)mighty(dot)co(dot)za>
To: pgsql-general(at)postgresql(dot)org
Subject: count(1) return 0?
Date: 2004-03-01 00:14:56
Message-ID: 20040301021456.77bc2dd2.zak@mighty.co.za (view raw or flat)
Thread:
Lists: pgsql-general
Hi all

is it possible to get a count(1) statemment, for example here:

select count(1) from results where fixture=4916 and winner=away group by winner;

to return a 0 value instead of absolutely nothing if no rows match fixture=4916
and winner=away? I get absolutely no results at all.


select count(1) from results where fixture=4916 and winner=home group by winner;
 count 
-------
(0 rows)

any ideas please?

Thanks

ciao

Zak

--
========================================================================
http://www.carfolio.com/        Searchable database of 10 000+ car specs
========================================================================

Responses

pgsql-general by date

Next:From: Bill MoranDate: 2004-03-01 00:55:15
Subject: Re: count(1) return 0?
Previous:From: Zak McGregorDate: 2004-02-29 23:17:06
Subject: Re: dumping fields from Perl

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group