Re: using column alias to make operations - Mailing list pgsql-novice

From A. Kretschmer
Subject Re: using column alias to make operations
Date
Msg-id 20080123101259.GE20579@a-kretschmer.de
Whole thread Raw
In response to using column alias to make operations  (Raimon Fernandez <coder@montx.com>)
List pgsql-novice
am  Wed, dem 23.01.2008, um 10:53:51 +0100 mailte Raimon Fernandez folgendes:
>
> On 23/01/2008, at 10:36, A. Kretschmer wrote:
>
> >am  Wed, dem 23.01.2008, um  9:10:09 +0100 mailte Raimon Fernandez
> >folgendes:
> >>I thought I could use the column alias, because in the ORDER BY
> >>clausule I can use them ...
> >
> >You can't, because first PG fetch the result, this result has the
> >column-aliases. A consecutively ORDER BY can access this aliases,
> >but not
> >the SELECT self.
>
> ok, thanks
>
> and PG knows that there are two identical operations, and just do it
> once and use that value, or does it twice ?

Yes, of course, the former.


Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

pgsql-novice by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: using column alias to make operations
Next
From: Andreas
Date:
Subject: Re: Need help with a function boolean --> text or array