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

Поиск
Список
Период
Сортировка
Искать
От
Mezei Zoltán
Тема
Re: Count and list only where count is bigger than 1
Дата
Msg-id
4510082F.203@telefor.hu
Ответ на
Список
Дерево обсуждения
Count and list only where count is bigger than 1 "Ezequias Rodrigues da Rocha" <ezequias.rocha@gmail.com>
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 "A. Kretschmer" <andreas.kretschmer@schollglas.com>
Re: Count and list only where count is bigger than 1 Mezei Zoltán <mezei.zoltan@telefor.hu>
 Ezequias Rodrigues da Rocha wrote: 
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 ?

What to do ?
Google/read tutorial for HAVING. E.g.

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

Zizi
В списке pgsql-sql по дате отправления
От: Ezequias Rodrigues da Rocha
Дата:
От: bnichols@ca.afilias.info
Дата:
FAQ