Re: SELECT syntax question - combining COUNT and DISTINCT

From: zmilos(at)sympatico(dot)ca (zhix)
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: SELECT syntax question - combining COUNT and DISTINCT
Date: 2003-10-07 00:38:25
Message-ID: c59f4459.0310061638.924d06a@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

This should give you distinct values counts:

select pdb_id,count(*)
from chain
where chain_id = 'A'
group by pdb_id;

zhix.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message zhix 2003-10-07 02:51:51 Re: SELECT syntax question - combining COUNT and DISTINCT
Previous Message Partha Sur 2003-10-07 00:27:41 Re: Filtering duplicated row with a trigger