X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 8D06E9FA1A1 for ; Tue, 19 Sep 2006 12:05:15 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 20600-07 for ; Tue, 19 Sep 2006 15:04:57 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.169]) by postgresql.org (Postfix) with ESMTP id 838DA9FB1CC for ; Tue, 19 Sep 2006 12:04:57 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id 30so464506ugc for ; Tue, 19 Sep 2006 08:04:55 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=RMIyUfKF/t5lfMQCSegP5G41Tgubg9psoN02dxKWrpZkDGRMRCosPQJT571DJ6QRzyLrkxi2BGDfDgpHf+REnXKVWcyQur8QIU0h89WREKdF1RyEKjPw8DyXS92Yc8k5UtVyYhLBpO8BJshuupwr2FwPzYH6ny7/PJEazT6c/6g= Received: by 10.66.220.17 with SMTP id s17mr7945459ugg; Tue, 19 Sep 2006 08:04:55 -0700 (PDT) Received: by 10.67.118.11 with HTTP; Tue, 19 Sep 2006 08:04:55 -0700 (PDT) Message-ID: <55c095e90609190804w1eaac2aanc660020995d3710a@mail.gmail.com> Date: Tue, 19 Sep 2006 12:04:55 -0300 From: "Ezequias Rodrigues da Rocha" To: pgsql-sql@postgresql.org Subject: Count and list only where count is bigger than 1 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_71834_1896702.1158678295382" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.696 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE, HTML_40_50, HTML_MESSAGE, SPF_PASS X-Spam-Level: X-Archive-Number: 200609/126 X-Sequence-Number: 26337 ------=_Part_71834_1896702.1158678295382 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi list, It is possible to make a count select and only display where count column i= s 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 ... --=20 =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Atenciosamente (Sincerely) Ezequias Rodrigues da Rocha =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- A pior das democracias ainda =E9 melhor do que a melhor das ditaduras The worst of democracies is still better than the better of dictatorships http://ezequiasrocha.blogspot.com/ ------=_Part_71834_1896702.1158678295382 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi list,

It is possible to make a count select and only display wher= e count column is bigger than 1 ?

My SQL is like this

SELECT = distinct cli.bairro, COUNT( * ) as qtd
FROM base.cliente cli
GROUP BY= =20 cli.cidade, cli.bairro
ORDER BY 2

I noticed that I cannot use "where qtd > 1" ok ?
What to do ?

Regards ...

--
=3D-=3D-= =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-
            = ;            &n= bsp;         Atenciosamente (S= incerely)
          &n= bsp;            = ; Ezequias Rodrigues da Rocha
=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-= =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-
A pior das democracias ainda =E9 melho= r do que a melhor das ditaduras
The worst of democracies is still better than the better of dictatorshi= ps
http://ezequiasrocha.= blogspot.com/ ------=_Part_71834_1896702.1158678295382--