Received: from localhost.localdomain (h246.ozemail2.ozemail.com.au [203.108.14.246]) by hub.org (8.9.3/8.9.3) with ESMTP id AAA71534 for ; Wed, 16 Jun 1999 00:03:27 -0400 (EDT) (envelope-from chris@tech.com.au) Received: from tech.com.au (localhost [127.0.0.1]) by localhost.localdomain (8.9.3/8.9.3) with ESMTP id OAA02708 for ; Wed, 16 Jun 1999 14:03:19 +1000 Sender: chris@localhost.localdomain Message-ID: <37672207.B77436B1@tech.com.au> Date: Wed, 16 Jun 1999 14:03:19 +1000 From: Chris Bitmead X-Mailer: Mozilla 4.6 [en] (X11; I; Linux 2.2.6 i686) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgreSQL.org Subject: Re: [SQL] DISTINCT count(*), possible? References: <4.1.19990615225634.009e7b60@mail.venux.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I can do it as two queries, but I don't know how to do it as one. select count(url) as foo into temp2 from urllink group by url; select count(foo) from temp2; Matthew Hagerty wrote: > > Greetings, > > Can someone tell me how I can get this to work? > > select DISTINCT count(address1) from aro; > > returns 240, which is wrong. But this: > > select DISTINCT address1 from aro; > > returns 219, which is exactally what I am looking for, minus the query > output. I don't need the tuples, just a count of distinct addresses. > > Thanks, > Matthew -- Chris Bitmead mailto:chris@tech.com.au http://www.techphoto.org - Photography News, Stuff that Matters