Re: WHERE on an alias

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: WHERE on an alias
Дата
Msg-id web-108012@davinci.ethosmedia.com
обсуждение исходный текст
Ответ на Re: WHERE on an alias  (Joseph Shraibman <jks@selectacast.net>)
Список pgsql-sql
Joseph,

> playpen=# SELECT a, sum(b) as dsum
> playpen-# FROM taba
> playpen-# GROUP BY a
> playpen-# HAVING dsum > 5;

Sorry, my mistake:

SELECT a, sum(b) as dsum
FROM taba
GROUP BY a
HAVING sum(b) > 5;

I had the impression that aliases for aggregates were allowed in
Postgres HAVING clauses.  Apparently not.

-Josh

______AGLIO DATABASE SOLUTIONS___________________________                                      Josh Berkus Complete
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco
 


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

Предыдущее
От: Joseph Shraibman
Дата:
Сообщение: Re: WHERE on an alias
Следующее
От: "Josh Berkus"
Дата:
Сообщение: Indexing and performance