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

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

pgsql-general by date

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

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