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

From: Chris Bitmead <chris(at)tech(dot)com(dot)au>
To: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] DISTINCT count(*), possible?
Date: 1999-06-16 04:03:19
Message-ID: 37672207.B77436B1@tech.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)tech(dot)com(dot)au
http://www.techphoto.org - Photography News, Stuff that Matters

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Chris Bitmead 1999-06-16 04:16:12 Postgres mailing lists
Previous Message Matthew Hagerty 1999-06-16 02:59:54 DISTINCT count(*), possible?