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

From Jeff Eckermann
Subject Re: where cannot use alias name of column?
Date
Msg-id 012701c13c5f$b6287930$279c10ac@INTERNAL
Whole thread Raw
In response to where cannot use alias name of column?  (Giorgio Volpe <giorgio.volpe@gtngroup.it>)
List pgsql-general
The WHERE clause is evaluated before the SELECT list, so the column aliases
are not available to be used at that point.
You can get away with using column alias in a GROUP BY (and SORT BY as
well?), but I believe that is not standard SQL.

----- Original Message -----
From: "Giorgio Volpe" <giorgio.volpe@gtngroup.it>
To: "Postgresql" <pgsql-general@postgresql.org>
Sent: Thursday, September 13, 2001 6:25 AM
Subject: [GENERAL] where cannot use alias name of column?


> 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
>
>
> --
>
>     Giorgio
>
> -----------------------------------------
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>
>


pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: where cannot use alias name of column?
Next
From: R Talbot
Date:
Subject: Re: Is Perl compiled into Version?