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

Re: count( distinct x )

From: Anthony <lists(at)a1(dot)org(dot)uk>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: count( distinct x )
Date: 2000-11-27 19:20:01
Message-ID: 3A22B3E1.68A66ABD@a1.org.uk (view raw or flat)
Thread:
Lists: pgsql-sql
Tom Lane wrote:

> Anthony <lists(at)a1(dot)org(dot)uk> writes:
> >     select count( distinct area ) from areapostcode where postcode like
> > 'BS1%'
> > the above statement fails with
> >     ERROR:  parser: parse error at or near "distinct"
>
> What Postgres version are you running?  Support for count(distinct foo)
> was added in 7.0, IIRC.
>
>                         regards, tom lane

select version();
version
-------------------------------------------------------------------
PostgreSQL 6.5.3 on i686-pc-linux-gnu, compiled by gcc egcs-2.91.66
(1 row)

bugger!

any ideas how to get same result at relative speed with different query?

Thanks Tom.



In response to

pgsql-sql by date

Next:From: Bernie HuangDate: 2000-11-27 19:22:45
Subject: a script that queries database periodically
Previous:From: Tom LaneDate: 2000-11-27 19:10:24
Subject: Re: count( distinct x )

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