Re: count(1) return 0? - Mailing list pgsql-general

From Kris Jurka
Subject Re: count(1) return 0?
Date
Msg-id Pine.LNX.4.33.0402292020470.21366-100000@leary.csoft.net
Whole thread Raw
In response to count(1) return 0?  (Zak McGregor <zak@mighty.co.za>)
List pgsql-general

On Mon, 1 Mar 2004, Zak McGregor wrote:

> 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.
>

Your problem is the GROUP BY.  If you take that off it should work as
expected.

Kris Jurka



pgsql-general by date:

Previous
From: Klint Gore
Date:
Subject: Re: count(1) return 0?
Next
From: Zak McGregor
Date:
Subject: Re: count(1) return 0?