Re: DUPS in tables columns ERROR: column ". . . " does not exist - Mailing list pgsql-general

From Albretch Mueller
Subject Re: DUPS in tables columns ERROR: column ". . . " does not exist
Date
Msg-id 9ef66fac0808300958k4bff2d8dj7e28d2880b60c0a8@mail.gmail.com
Whole thread Raw
In response to Re: DUPS in tables columns ERROR: column ". . . " does not exist  (Stefan Kaltenbrunner <stefan@kaltenbrunner.cc>)
Responses Re: DUPS in tables columns ERROR: column ". . . " does not exist
List pgsql-general
 thank you Stefan your SQL worked, but still; I am just asking and my
programming bias will certainly show, but aren't you effectivly
"calling" count on the table three times if you go:
~
SELECT md5, COUNT(md5)
FROM jdk1_6_0_07_txtfls_md5
GROUP BY md5
HAVING COUNT(md5) > 1
ORDER BY COUNT(md5) DESC;
~
 Shouldn't
~
SELECT md5, COUNT(md5) AS CNT
FROM jdk1_6_0_07_txtfls_md5
GROUP BY md5
HAVING CNT > 1
ORDER BY CNT DESC;
~
 work?
~
jpk=# SELECT md5, COUNT(md5) AS CNT
FROM jdk1_6_0_07_txtfls_md5
GROUP BY md5
HAVING CNT > 1
ORDER BY CNT DESC;
jpk-# jpk-# jpk-# jpk-# ERROR:  column "cnt" does not exist
LINE 4: HAVING CNT > 1
~
 Thanks
 lbrtchx

pgsql-general by date:

Previous
From: Steve Atkins
Date:
Subject: Re: ERROR: relation . . . does not exist
Next
From: Tom Lane
Date:
Subject: Re: DUPS in tables columns ERROR: column ". . . " does not exist