Re: where cannot use alias name of column? - Mailing list pgsql-general

From Stephan Szabo
Subject Re: where cannot use alias name of column?
Date
Msg-id Pine.BSF.4.21.0109130722150.35960-100000@megazone23.bigpanda.com
Whole thread Raw
In response to where cannot use alias name of column?  (Giorgio Volpe <giorgio.volpe@gtngroup.it>)
List pgsql-general
On Thu, 13 Sep 2001, Giorgio Volpe wrote:

> May be it's my ignorance about sql ...
> but why cannot i use alias name of a column in a where clause?
>
> # select key as cc from mytable where cc > 0;
> ERROR:  Attribute 'cc' not found

Because the select list (the key as cc part) isn't
evaluated until after the where clause determines
which rows to evaluate it for.



pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: count of occurences PLUS optimisation
Next
From: "Jeff Eckermann"
Date:
Subject: Re: where cannot use alias name of column?