Re: count function alternative in postgres

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: count function alternative in postgres
Дата
Msg-id 20647.1270311446@sss.pgh.pa.us
обсуждение исходный текст
Ответ на count function alternative in postgres  (junaid malik <junaidmalik14@gmail.com>)
Список pgsql-general
junaid malik <junaidmalik14@gmail.com> writes:
> Is there any alternative of mysql function COUNT(DISTINCT expr,
> [expr...]) in postgres. We get error if we

The SQL-standard way to do that would be

select count(*) from (select distinct expr,expr,... from ...) as ss;

COUNT with multiple arguments is not anywhere in the standard.

            regards, tom lane

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

Предыдущее
От: junaidmalik14
Дата:
Сообщение: count function alternative in postgres
Следующее
От: raghavendra t
Дата:
Сообщение: ERROR: cache lookup failed for relation X