Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id BC5DD4765DD for ; Thu, 9 May 2002 15:09:15 -0400 (EDT) Received: from smtp6.mindspring.com (smtp6.mindspring.com [207.69.200.110]) by postgresql.org (Postfix) with ESMTP id 3997247617A for ; Thu, 9 May 2002 15:07:49 -0400 (EDT) Received: from user-38ldg5v.dialup.mindspring.com ([209.86.192.191] helo=dominion.dyndns.org) by smtp6.mindspring.com with esmtp (Exim 3.33 #1) id 175tFk-0005y9-00; Thu, 09 May 2002 15:07:00 -0400 Received: from there (godzilla [10.0.1.2]) by dominion.dyndns.org (Postfix) with SMTP id 6FC763FEF; Wed, 8 May 2002 16:14:06 -0400 (EDT) Content-Type: text/plain; charset="iso-8859-1" From: Mike Diehl Reply-To: jdiehl@sandia.gov To: "Ian Barwick" , pgsql-sql@postgresql.org Subject: Re: having trouble w/ having clause... Date: Thu, 9 May 2002 13:21:42 -0600 X-Mailer: KMail [version 1.3.1] References: <20020507215118.239013F33@dominion.dyndns.org> <200205090113.22872.barwick@gmx.net> In-Reply-To: <200205090113.22872.barwick@gmx.net> Organization: Sandia MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <20020508201406.6FC763FEF@dominion.dyndns.org> X-Archive-Number: 200205/80 X-Sequence-Number: 7716 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