Re: where cannot use alias name of column?

Поиск
Список
Период
Сортировка
От Jeff Eckermann
Тема Re: where cannot use alias name of column?
Дата
Msg-id 012701c13c5f$b6287930$279c10ac@INTERNAL
обсуждение исходный текст
Ответ на where cannot use alias name of column?  (Giorgio Volpe <giorgio.volpe@gtngroup.it>)
Список 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 по дате отправления:

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: where cannot use alias name of column?
Следующее
От: R Talbot
Дата:
Сообщение: Re: Is Perl compiled into Version?