From: Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Count and list only where count is bigger than 1
Date: Tue, 19 Sep 2006 12:04:55 -0300
Message-ID: <55c095e90609190804w1eaac2aanc660020995d3710a@mail.gmail.com> (raw)
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/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: ezequias.rocha@gmail.com
Subject: Re: Count and list only where count is bigger than 1
In-Reply-To: <55c095e90609190804w1eaac2aanc660020995d3710a@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox