Re: DUPS in tables columns ERROR: column ". . . " does not exist

From: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
To: Albretch Mueller <lbrtchx(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: DUPS in tables columns ERROR: column ". . . " does not exist
Date: 2008-08-30 14:24:52
Message-ID: 48B95834.5040801@kaltenbrunner.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Albretch Mueller wrote:
> Hi,
> ~
> I am trying to get dups from some data from files which md5sums I
> previously calculated
> ~
> Here is my mere mortal SQL
> ~
> SELECT md5, COUNT(md5) AS md5cnt
> FROM jdk1_6_0_07_txtfls_md5
> WHERE (md5cnt > 1)
> GROUP BY md5
> ORDER BY md5cnt DESC;

I think you are looking for HAVING as in:

SELECT md5, COUNT(md5)
FROM jdk1_6_0_07_txtfls_md5
GROUP BY md5
HAVING count(md5) > 1

Stefan

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Christophe 2008-08-30 16:19:14 Re: ERROR: relation . . . does not exist
Previous Message Albretch Mueller 2008-08-30 13:26:44 Re: ERROR: relation . . . does not exist