Re: Count and list only where count is bigger than 1

Поиск
Список
Период
Сортировка
От bnichols@ca.afilias.info
Тема Re: Count and list only where count is bigger than 1
Дата
Msg-id 1148.207.219.45.39.1158678586.squirrel@look.libertyrms.com
обсуждение исходный текст
Ответ на Count and list only where count is bigger than 1  ("Ezequias Rodrigues da Rocha" <ezequias.rocha@gmail.com>)
Список pgsql-sql
> Hi list,
>
> It is possible to make a count select and only display where count column
> is
> bigger than 1 ?
>
> My SQL is like this
>
> SELECT distinct cli.bairro, COUNT( * ) as qtd
> FROM base.cliente cli
> GROUP BY cli.cidade, cli.bairro
> ORDER BY 2
>
> I noticed that I cannot use "where qtd > 1" ok ?

SELECT distinct cli.bairro, COUNT( * ) as qtd
FROM base.cliente cli
GROUP BY cli.cidade, cli.bairro
HAVING count(*) > 1;





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

Предыдущее
От: Mezei Zoltán
Дата:
Сообщение: Re: Count and list only where count is bigger than 1
Следующее
От: "A. Kretschmer"
Дата:
Сообщение: Re: Count and list only where count is bigger than 1