Re: having trouble w/ having clause...

Поиск
Список
Период
Сортировка
От Mike Diehl
Тема Re: having trouble w/ having clause...
Дата
Msg-id 20020508201406.6FC763FEF@dominion.dyndns.org
обсуждение исходный текст
Ответ на Re: having trouble w/ having clause...  (Ian Barwick <barwick@gmx.net>)
Список 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
namefor an output column using the AS clause. This    > name is primarily used to label the column for display. It can
alsobe    > used to refer to the column's value in ORDER BY and GROUP BY clauses.    > But the output_name cannot be
usedin the WHERE or HAVING clauses;    > write out the expression instead."    >    > HTH    >    > Ian Barwick
 

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


В списке pgsql-sql по дате отправления:

Предыдущее
От: James Orr
Дата:
Сообщение: Re: Help with indexes
Следующее
От: Gabriel Dovalo Carril
Дата:
Сообщение: Re: Can this query be faster?