Re: Why lower's not accept an AS declaration ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Hervé Piedvache <herve(at)elma(dot)fr>
Cc: Darko Prenosil <darko(dot)prenosil(at)finteh(dot)hr>, Postgresql General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Why lower's not accept an AS declaration ?
Date: 2003-08-18 19:23:12
Message-ID: 118.1061234592@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

=?iso-8859-15?q?Herv=E9=20Piedvache?= <herve(at)elma(dot)fr> writes:
> Is it an example more realistic for you to make an order by lower of
> something as an alias ?

Aliases attached to SELECT output columns are visible outside the
SELECT, not inside it. The special case for ORDER BY simple-column-name
is a kluge for compatibility with a now-obsolete version of the SQL spec
(SQL92 expects this to work, SQL99 doesn't) and we aren't going to
extend it. See past discussions in the archives (I seem to recall
answering this same question within the past week...)

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2003-08-18 19:34:19 Re: Why lower's not accept an AS declaration ?
Previous Message Bruno Wolff III 2003-08-18 19:06:42 Re: newbie and no idea