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

COUNT doesn't shows items with 0 occurrance

From: "Giorgio A(dot)" <jh(at)libero(dot)it>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: COUNT doesn't shows items with 0 occurrance
Date: 2001-07-17 15:01:27
Message-ID: 001901c10ed1$5adfba90$3302a8c0@ducale.mentelocale.bogus (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
hi all,
i have this little problem: when i do a

SELECT COUNT (*) AS number, pieces
FROM hardware
GROUP BY pieces

if a pieces has 'number = 0' it's not shown in the result report ... how can
i fix this, having as a result the whole list of my hardware pieces ?

tnx !

have a nice day

Giorgio A.

In response to


pgsql-novice by date

Next:From: Jiri D. HoogeveenDate: 2001-07-17 15:21:05
Subject: execute sql in a function?
Previous:From: Tom LaneDate: 2001-07-16 16:18:14
Subject: Re: GROUP BY and aggregate functions

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