Received: from mail.netgates.co.uk (mail.netgates.co.uk [194.105.64.74]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eARHnZt59219 for ; Mon, 27 Nov 2000 12:49:35 -0500 (EST) (envelope-from lists@a1.org.uk) Received: from a1.org.uk (martha.netgates.co.uk [194.105.64.211]) by mail.netgates.co.uk (Mirapoint) with ESMTP id BAO00175 (AUTH anthony); Mon, 27 Nov 2000 17:49:47 GMT Message-ID: <3A229EBB.F55BA11@a1.org.uk> Date: Mon, 27 Nov 2000 17:49:47 +0000 From: Anthony X-Mailer: Mozilla 4.72 [en] (X11; I; Linux 2.2.12 i386) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: count( distinct x ) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200011/241 X-Sequence-Number: 272 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.