Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-general by date

Next:From: ChristopheDate: 2008-08-30 16:19:14
Subject: Re: ERROR: relation . . . does not exist
Previous:From: Albretch MuellerDate: 2008-08-30 13:26:44
Subject: Re: ERROR: relation . . . does not exist

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group