Saturday, August 30, 2008

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

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

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

No comments: