Thread: DISTINCT count(*), possible?

DISTINCT count(*), possible?

From
Matthew Hagerty
Date:
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


Re: [SQL] DISTINCT count(*), possible?

From
Chris Bitmead
Date:
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