Re: count(1) return 0?

From: Kris Jurka <books(at)ejurka(dot)com>
To: Zak McGregor <zak(at)mighty(dot)co(dot)za>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: count(1) return 0?
Date: 2004-03-01 01:21:24
Message-ID: Pine.LNX.4.33.0402292020470.21366-100000@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Zak McGregor 2004-03-01 01:27:39 Re: count(1) return 0?
Previous Message Klint Gore 2004-03-01 01:13:07 Re: count(1) return 0?