Re: SELECT DISTINCT and count(1)

Поиск
Список
Период
Сортировка
От nobs@nobswolf.info (Emil Obermayr)
Тема Re: SELECT DISTINCT and count(1)
Дата
Msg-id 20090716104212.GT30035@nobswolf.info
обсуждение исходный текст
Ответ на SELECT DISTINCT and count(1)  (A B <gentosaker@gmail.com>)
Список pgsql-novice
On Thu, Jul 16, 2009 at 11:57:56AM +0200, A B wrote:
>
> select distinct userid  from  usertable,<more tables>  where <conditions>;
>
> and then count the rows in the result

make it a subselect and count in the outer select:

select count(*) as num from (select distinct...) dummy;

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

Предыдущее
От: A B
Дата:
Сообщение: Re: SELECT DISTINCT and count(1)
Следующее
От: A B
Дата:
Сообщение: need some more select help