From: Mikael Hedin <mikael.hedin@irf.se>
To: pgsql-sql@postgresql.org
Subject: problem to count (distinct number)
Date: 17 Jan 2001 16:51:34 +0100
Message-ID: <8766jemb21.fsf@zodiac.irf.se> (raw)
Hi,
I have a table with a column (int4), and I want to know how many
different numbers there are. In an example book I saw the query
SELECT COUNT (DISTINCT data ) FROM media;
by then I get
ERROR: parser: parse error at or near "distinct"
Is the query in error or does PostgreSQL not support this? How do I
then get the number of distinct data from my table?
TIA,
Micce
--
Mikael Hedin, MSc +46 (0)980 79176
Swedish Institute of Space Physics +46 (0)8 344979 (home)
S-Box 812, 981 28 KIRUNA, Sweden +46 (0)70 5891533 (mobile)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: mikael.hedin@irf.se
Subject: Re: problem to count (distinct number)
In-Reply-To: <8766jemb21.fsf@zodiac.irf.se>
References: <8766jemb21.fsf@zodiac.irf.se>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox