Re: [SQL] DISTINCT count(*), possible? - Mailing list pgsql-sql

From Chris Bitmead
Subject Re: [SQL] DISTINCT count(*), possible?
Date
Msg-id 37672207.B77436B1@tech.com.au
Whole thread Raw
In response to DISTINCT count(*), possible?  (Matthew Hagerty <matthew@venux.net>)
List pgsql-sql
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


pgsql-sql by date:

Previous
From: Matthew Hagerty
Date:
Subject: DISTINCT count(*), possible?
Next
From: Chris Bitmead
Date:
Subject: Postgres mailing lists