Ordering Error - Mailing list pgsql-novice

From Jason Davis
Subject Ordering Error
Date
Msg-id 5.1.0.14.0.20030810230808.01fbc070@pop.ltn.tassie.net.au
Whole thread Raw
Responses Re: Ordering Error
Re: Ordering Error
List pgsql-novice
Hi all

Searched the docs, archives etc. but can't find any reference to this
problem I'm having with ORDER BY used in conjunction with SELECT...AS.

A simplified demonstration:

radius=# SELECT col1 AS testing FROM test ORDER BY testing ASC;
  testing
----------
  Ordering
  Test
  This
  an
  is
(5 rows)

But I need the lowercased ordering result for this column for a
case-insensitivity listing, however I get

radius=# SELECT col1 AS testing FROM test ORDER BY lower(testing) ASC;
ERROR:  Attribute "testing" not found

Using the ordinal notation (ie. ORDER BY lower(1) ASC) gives weird results
(in my original query).

I can't use ORDER BY lower(col1) in my original and more complex query as
the column is the result of a function.

What obviousness would I be missing here?

version = 7.3.2

cheers
Jason


pgsql-novice by date:

Previous
From: James Williams
Date:
Subject: Re: Upgrade 7.2 to 7.3
Next
From: Nabil Sayegh
Date:
Subject: Re: Ordering Error