Reusing columns in SELECT list

From: Andre Majorel <aym-lqsgp(at)teaser(dot)fr>
To: pgsql-novice(at)postgresql(dot)org
Subject: Reusing columns in SELECT list
Date: 2006-02-13 12:55:16
Message-ID: 20060213125516.GB1836@vulcain.knox.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2006-02-13 14:29:38 Re: Reusing columns in SELECT list
Previous Message GIGI 2006-02-13 12:21:48 BLOB type storing... once again?