Re: count (DISTINCT expression [ , ... ] ) and documentation

Поиск
Список
Период
Сортировка
От David Fetter
Тема Re: count (DISTINCT expression [ , ... ] ) and documentation
Дата
Msg-id 20081226184325.GC4185@fetter.org
обсуждение исходный текст
Ответ на count (DISTINCT expression [ , ... ] ) and documentation  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Ответы Re: count (DISTINCT expression [ , ... ] ) and documentation  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Список pgsql-general
On Fri, Dec 26, 2008 at 03:34:33PM +0100, Ivan Sergio Borgonovo wrote:
> I noticed that starting from 8.2 the documentation at
> http://www.postgresql.org/docs/8.2/interactive/sql-expressions.html
> say that multiple distinct expressions are supported
>
> aggregate_name (DISTINCT expression [, expression] )

In 8.4, you'll be able to do:

WITH d AS (
    SELECT DISTINCT c1, c2 FROM table1
)
SELECT count(*) FROM d;

and very likely an OLAP version. :)

Cheers,
David.
>
> While previous docs just listed one:
>
> aggregate_name (DISTINCT expression)
>
> Still I'm using 8.3 and
>
> select count(distinct c1, c2) from table1;
>
> report:
>
> No function matches the given name and argument types. You might
> need to add explicit type casts.
>
> What should I write in spite of?
>
> select count(distinct c1, c2) from table1;
>
> --
> Ivan Sergio Borgonovo
> http://www.webthatworks.it
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

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

Предыдущее
От: Ivan Sergio Borgonovo
Дата:
Сообщение: Re: count (DISTINCT expression [ , ... ] ) and documentation
Следующее
От: "Pavel Stehule"
Дата:
Сообщение: Re: count (DISTINCT expression [ , ... ] ) and documentation