counting distinct rows on more than one column

Поиск
Список
Период
Сортировка
От Dirk Lutzebaeck
Тема counting distinct rows on more than one column
Дата
Msg-id 15041.65308.150764.131312@ampato.core.aeccom.com
обсуждение исходный текст
Ответы Re: counting distinct rows on more than one column  (Michael Fork <mfork@toledolink.com>)
Re: counting distinct rows on more than one column  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
Hi,

on 7.0.3 want to COUNT
 SELECT DISTINCT a,b FROM t;

I can't find a solution because any combination with
count with more than one column gives syntax errors.

One solution would be to set a view:

CREATE VIEW v AS SELECT DISTINCT a,b FROM t;

and then

SELECT count(a) FROM v

but views don't support distinct in v7.0.3

Ok I could use a temporary table but my select distinct tends to give
large results.

Any clues?

Dirk




В списке pgsql-sql по дате отправления:

Предыдущее
От: "Poul L. Christiansen"
Дата:
Сообщение: Re: Killing Postmaster
Следующее
От: Michael Ansley
Дата:
Сообщение: RE: counting distinct rows on more than one column