From: Chris Bitmead <chris@tech.com.au>
To: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] DISTINCT count(*), possible?
Date: Wed, 16 Jun 1999 14:03:19 +1000
Message-ID: <37672207.B77436B1@tech.com.au> (raw)
References: <4.1.19990615225634.009e7b60@mail.venux.net>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: chris@tech.com.au
Subject: Re: [SQL] DISTINCT count(*), possible?
In-Reply-To: <37672207.B77436B1@tech.com.au>
References: <4.1.19990615225634.009e7b60@mail.venux.net> <37672207.B77436B1@tech.com.au>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox