Re: Reusing columns in SELECT list

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andre Majorel <aym-lqsgp(at)teaser(dot)fr>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Reusing columns in SELECT list
Date: 2006-02-13 14:29:38
Message-ID: 28240.1139840978@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Andre Majorel <aym-lqsgp(at)teaser(dot)fr> writes:
> Is there a way to reuse in the SELECT list columns defined earlier
> in it ?

No.

You can use multiple levels of select:

select xy, xy + xy from (select x * y as xy from a,b) ss;

but this is not likely to save any computation, just typing.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Luis Silva 2006-02-13 15:36:06 Re: substring result
Previous Message Andre Majorel 2006-02-13 12:55:16 Reusing columns in SELECT list