Re: DISTINCT and COUNT help

From: Manfred Koizar <mkoi-pg(at)aon(dot)at>
To: Julie Keywell <julie(at)iparenting(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: DISTINCT and COUNT help
Date: 2002-06-28 09:24:50
Message-ID: e2aohusr05gfipui4m467mii23au3pc48e@4ax.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Fri, 28 Jun 2002 00:10:56 -0500, Julie Keywell <julie(at)iparenting(dot)com> wrote:
>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?
Julie, it's so obvious, you didn't dare to think of it :-)

SELECT COUNT(DISTINCT col) FROM t;

Servus
Manfred

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Aarni Ruuhimäki / Megative Tmi / KYMI.com 2002-06-28 09:57:05 Parser function / command ?
Previous Message Chris 2002-06-28 05:20:50 Re: DISTINCT and COUNT help