Re: Simple SQL

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz>
Cc: Bob Messenger <bob(at)cassiancapital(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Simple SQL
Date: 2003-10-24 11:13:03
Message-ID: 20031024111303.GC27673@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Oct 24, 2003 at 07:25:44AM +0200, Pavel Stehule wrote:
> Not
>
> SELECT 1 as a, a*2;
> ERROR: column "a" does not exist

But you can try

SELECT a, a*a FROM (select 1 as a);

> On Tue, 21 Oct 2003, Bob Messenger wrote:
>
> > Is it possible to do something like:
> >
> > select 1 as a, a*a;
> >
> > in postgres?

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Hay que recordar que la existencia en el cosmos, y particularmente la
elaboración de civilizaciones dentre de él no son, por desgracia,
nada idílicas" (Ijon Tichy)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message TommyC 2003-10-24 12:08:09 unsubscribe
Previous Message Cláudia Morgado 2003-10-24 10:26:38 Re: Hierarchical query's