| От | Tom Lane |
|---|---|
| Тема | Re: can not use the column after rename |
| Дата | |
| Msg-id | 5866.1324483584@sss.pgh.pa.us обсуждение |
| Ответ на | Re: can not use the column after rename (salah jubeh <s_jubeh@yahoo.com>) |
| Список | pgsql-general |
salah jubeh <s_jubeh@yahoo.com> writes:
> On the row level,� the value of a and b are know, so why we need a temporary table or CTE. Why I can not use it
directly�as shown in the example below. why a and b can not be used as aliases for the column names ? I want to know
thetheoretical reason behind it?
The SQL standard envisions all the expressions in a SELECT list being
computed concurrently and independently. So they can't refer to each
other. If they could, it would introduce ambiguity. Consider a table
t that provides columns x,y,z, and suppose we have
SELECT x AS z, y, y+z AS sum FROM t;
If cross-references were allowed, it would be unclear what the last "z"
is supposed to refer to.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера