Re: problem to count (distinct number)

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Mikael Hedin <mikael(dot)hedin(at)irf(dot)se>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: problem to count (distinct number)
Date: 2001-01-18 21:01:16
Message-ID: Pine.BSF.4.21.0101181258520.1294-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


What version are you using? I believe this was added in 7.0.x, but
I could be wrong about that. A query of this sort works on my
7.1beta3 system.

On 17 Jan 2001, Mikael Hedin wrote:
> 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?

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2001-01-18 21:09:38 Re: problem to count (distinct number)
Previous Message Jie Liang 2001-01-18 20:59:25 Re: problem to count (distinct number)