Re: reusing column labels in select

From: Kevin Barnard <kevin(dot)barnard(at)gmail(dot)com>
To: ryan <rvanroode(at)gmail(dot)com>
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: reusing column labels in select
Date: 2004-10-19 22:16:01
Message-ID: b068057c0410191516dcc3b38@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

There might be a better way then this but this works

SELECT a, a+1 as b from (SELECT 1+1 as a) as ab;

On 16 Oct 2004 11:18:48 -0700, ryan <rvanroode(at)gmail(dot)com> wrote:
> Hello,
>
> Is there any way to reuse a column label in a select list like this:
>
> SELECT 1 + 1 AS a, a + 1 AS b;
>
> I vaguely remember being able to do something like this in oracle. Any
> ideas? Thanks!
>
> ~RvR
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Steven Klassen 2004-10-19 22:18:46 Re: reusing column labels in select
Previous Message Kevin Barnard 2004-10-19 22:09:21 Re: [PERFORM] Performance on Win32 vs Cygwin