Re: DISTINCT and COUNT help - Mailing list pgsql-novice

From Chris
Subject Re: DISTINCT and COUNT help
Date
Msg-id 5.1.0.14.0.20020628151949.027f1d70@cooee.cybersydney.com.au
Whole thread Raw
In response to DISTINCT and COUNT help  (Julie Keywell <julie@iparenting.com>)
List pgsql-novice
Hi Julie,

>I would like to count the number of distinct values in a column.  Is
>there any way to combine DISTINCT and COUNT and if so, what is the
>syntax?

Sure is.

SELECT DISTINCT column, COUNT(column) FROM table GROUP BY column;

HTH,

-----------------
      Chris Smith
http://www.squiz.net/




pgsql-novice by date:

Previous
From: Julie Keywell
Date:
Subject: DISTINCT and COUNT help
Next
From: Manfred Koizar
Date:
Subject: Re: DISTINCT and COUNT help