Reusing columns in SELECT list

Поиск
Список
Период
Сортировка
От Andre Majorel
Тема Reusing columns in SELECT list
Дата
Msg-id 20060213125516.GB1836@vulcain.knox.com
обсуждение исходный текст
Ответы Re: Reusing columns in SELECT list  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice
Hello all.

Is there a way to reuse in the SELECT list columns defined earlier
in it ? With PostgreSQL 8.0, I couldn't manage to do it :

  => CREATE table a (x int);
  CREATE TABLE
  => CREATE table b (y int);
  CREATE TABLE
  => SELECT x * y AS xy, xy + xy AS twoxy FROM a, b;
  ERROR:  column "xy" does not exist

--
André Majorel <URL:http://www.teaser.fr/~amajorel/>
Do not use this account for regular correspondence.
See the URL above for contact information.

В списке pgsql-novice по дате отправления:

Предыдущее
От: "A. Kretschmer"
Дата:
Сообщение: Re: substring result
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Reusing columns in SELECT list