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

From: "Albretch Mueller" <lbrtchx(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: DUPS in tables columns ERROR: column ". . . " does not exist
Date: 2008-08-30 16:58:06
Message-ID: 9ef66fac0808300958k4bff2d8dj7e28d2880b60c0a8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-08-30 17:05:01 Re: DUPS in tables columns ERROR: column ". . . " does not exist
Previous Message Steve Atkins 2008-08-30 16:43:37 Re: ERROR: relation . . . does not exist