pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mike Diehl <jdiehl@sandia.gov>
To: Ian Barwick <barwick@gmx.net>
To: pgsql-sql@postgresql.org
Subject: Re: having trouble w/ having clause...
Date: Thu, 9 May 2002 13:21:42 -0600
Message-ID: <20020508201406.6FC763FEF@dominion.dyndns.org> (raw)
In-Reply-To: <200205090113.22872.barwick@gmx.net>
References: <Pine.LNX.4.44.0205080903080.11632-100000@bluebell.marzen.de>
	<20020507215118.239013F33@dominion.dyndns.org>
	<200205090113.22872.barwick@gmx.net>

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



view thread (4+ messages)  latest in thread

Message-ID: <20020508201406.6FC763FEF@dominion.dyndns.org>
Permalink:  ../20020508201406.6FC763FEF@dominion.dyndns.org/
Also on:    postgresql.org/message-id/20020508201406.6FC763FEF@dominion.dyndns.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: jdiehl@sandia.gov, barwick@gmx.net
  Subject: Re: having trouble w/ having clause...
  In-Reply-To: <20020508201406.6FC763FEF@dominion.dyndns.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox