Count and list only where count is bigger than 1

From: "Ezequias Rodrigues da Rocha" <ezequias(dot)rocha(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Count and list only where count is bigger than 1
Date: 2006-09-19 15:04:55
Message-ID: 55c095e90609190804w1eaac2aanc660020995d3710a@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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 ?

What to do ?

Regards ...

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Atenciosamente (Sincerely)
Ezequias Rodrigues da Rocha
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
A pior das democracias ainda é melhor do que a melhor das ditaduras
The worst of democracies is still better than the better of dictatorships
http://ezequiasrocha.blogspot.com/

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Mezei Zoltán 2006-09-19 15:09:35 Re: Count and list only where count is bigger than 1
Previous Message Tom Lane 2006-09-19 15:03:07 Re: Nested loops are killing throughput