count( distinct x ) - Mailing list pgsql-sql

From Anthony
Subject count( distinct x )
Date
Msg-id 3A229EBB.F55BA11@a1.org.uk
Whole thread Raw
Responses Re: count( distinct x )
Re: count( distinct x )
Re: count( distinct x )
List pgsql-sql
Apologies if this has been asked b4, but got this result when
attemplting to search the archives on the website

Not Found

The requested URL /mhonarc/pgsql-sql/search.cgi was not found on this
server.


Apache/1.3.12 Server at postgresql.rmplc.co.uk Port 80

The problem I have is with this statement:
   select count( distinct area ) from areapostcode where postcode like
'BS1%'

the above statement fails with   ERROR:  parser: parse error at or near "distinct"

I am not the greatest when it comes to SQL, but the pgsql docs implied
that the above would work.

What I am trying to do is get a count of the no of matches from the
statement below   select distinct area from areapostcode where postcode like 'BS1%'

Not the count of:   select area from areapostcode where postcode like 'BS1%'

Can anyone help?

TIA
Bap.


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Bad performing DELETE
Next
From: Jose Rodrigo Fernandez Menegazzo
Date:
Subject: Re: count( distinct x )