Re: having trouble w/ having clause...

From: Mike Diehl <jdiehl(at)sandia(dot)gov>
To: "Ian Barwick" <barwick(at)gmx(dot)net>, pgsql-sql(at)postgresql(dot)org
Subject: Re: having trouble w/ having clause...
Date: 2002-05-09 19:21:42
Message-ID: 20020508201406.6FC763FEF@dominion.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

Yep, this fixed it. Thanx,

On Wednesday 08 May 2002 05:13 pm, Ian Barwick wrote:
> On Wednesday 08 May 2002 22:58, Mike Diehl wrote:
> > Hi all,
> >
> > This is a simple question, but for the life of me, I can't see what
> > is wrong with this query:
> >
> > select host,slot,port,count(mac) as d from cam group by
> > host,slot,port having d>1;
>
> Try:
>
> select host,slot,port,count(mac) as d from cam group by host,slot,port
> having count(mac) > 1
>
> See:
>
> http://www.postgresql.org/idocs/index.php?sql-select.html
>
> "output_name
>
> Specifies another name for an output column using the AS clause. This
> name is primarily used to label the column for display. It can also be
> used to refer to the column's value in ORDER BY and GROUP BY clauses.
> But the output_name cannot be used in the WHERE or HAVING clauses;
> write out the expression instead."
>
> HTH
>
> Ian Barwick

--
Mike Diehl
Network Tools Devl.
Sandia Labs
(505) 284-3137

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter E. Chen 2002-05-09 19:39:18 Quick SQL question . . .
Previous Message Tom Lane 2002-05-09 17:39:33 Re: Psql 7.2.1 Regress tests failed on RedHat 7.3

Browse pgsql-sql by date

  From Date Subject
Next Message Vincent Stoessel 2002-05-09 21:00:12 Re: escaping arrays in perl dbi
Previous Message James Orr 2002-05-09 19:03:36 Re: Help with indexes