Re: Using column aliasses in the same query

From: Andrej <andrej(dot)groups(at)gmail(dot)com>
To: Tore Halvorsen <tore(dot)halvorsen(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Using column aliasses in the same query
Date: 2011-04-19 22:13:28
Message-ID: BANLkTimGr3nsM3ksurQ6Xcr_QWhWfCr5eg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 18 April 2011 22:06, Tore Halvorsen <tore(dot)halvorsen(at)gmail(dot)com> wrote:

> Well, refering to the computed value may be nonsensical, but
> couldn't it be some sort of query rewrite? So that...
>
>    SELECT x/y AS z FROM tab WHERE y <> 0 AND z > 2
>
> ... is a shorthand for
>
>    SELECT x/y AS z FROM tab WHERE y <> 0 AND x/y > 2
>
> No big deal, since there are lots of other ways to do this.

That's an accurate observation, but has nothing to do w/ what
the original poster was looking for, nor does it refute Toms
argument against the OPs suggestion.

Cheers,
Andrej

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message SUBHAM ROY 2011-04-19 23:06:21 Needs Suggestion
Previous Message Steve Crawford 2011-04-19 20:40:29 Re: Questions about Partitioning