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

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 (view raw or flat)
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

pgsql-novice by date

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

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