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

Поиск
Список
Период
Сортировка
От Chris Bitmead
Тема Re: [SQL] DISTINCT count(*), possible?
Дата
Msg-id 37672207.B77436B1@tech.com.au
обсуждение исходный текст
Ответ на DISTINCT count(*), possible?  (Matthew Hagerty <matthew@venux.net>)
Список 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 по дате отправления:

Предыдущее
От: Matthew Hagerty
Дата:
Сообщение: DISTINCT count(*), possible?
Следующее
От: Chris Bitmead
Дата:
Сообщение: Postgres mailing lists