Re: counting distinct rows on more than one column

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: counting distinct rows on more than one column
Дата
Msg-id 18315.985795851@sss.pgh.pa.us
обсуждение исходный текст
Ответ на counting distinct rows on more than one column  (Dirk Lutzebaeck <lutzeb@aeccom.com>)
Список pgsql-sql
Dirk Lutzebaeck <lutzeb@aeccom.com> writes:
> on 7.0.3 want to COUNT
>   SELECT DISTINCT a,b FROM t;

In 7.1 you could do
select count(*) from (select distinct a,b from t) as t1;

In 7.0 and before I think you have no choice but to use a temp table.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: DELETE FROM fails with error
Следующее
От: "Douglas Brunton"
Дата:
Сообщение: Oracle -> Postgresql migration