Re: A select DISTINCT query?

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Phil Rhoades <phil(at)pricom(dot)com(dot)au>
Cc: Tino Wildenhain <tino(at)wildenhain(dot)de>, pgsql-general(at)postgresql(dot)org
Subject: Re: A select DISTINCT query?
Date: 2008-01-27 16:35:47
Message-ID: 20080127163547.GB22276@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Jan 28, 2008 at 03:32:18AM +1100, Phil Rhoades wrote:
> SELECT count(*) as cnt, name FRoM tst GROUP BY name HAVING cnt = 1 ;
> ERROR: column "cnt" does not exist
> LINE 1: ...ount(*) as cnt, name FRoM tst GROUP BY name HAVING cnt = 1 ;

having count(*) = 1;

depesz

--
quicksil1er: "postgres is excellent, but like any DB it requires a
highly paid DBA. here's my CV!" :)
http://www.depesz.com/ - blog dla ciebie (i moje CV)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2008-01-27 16:38:23 Re: A select DISTINCT query?
Previous Message Phil Rhoades 2008-01-27 16:32:18 Re: A select DISTINCT query?