Search Postgresql Archives

How to use result column names in having cause

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



CREATE TEMP TABLE foo( bar integer );

SELECT 123 AS x
  FROM foo
  GROUP BY 1
  HAVING x> AVG(bar)

causes

ERROR:  column "x" does not exist

Why ? How to make this working ?

In real application I have long expression instead of 123 and do'nt want
 repeat this expression in HAVING clause.

In VFP this select works OK.

Andrus. 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux