Re: Why lower's not accept an AS declaration ? - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: Why lower's not accept an AS declaration ?
Date
Msg-id 20030818185913.GA2816@wolff.to
Whole thread Raw
In response to Re: Why lower's not accept an AS declaration ?  (Hervé Piedvache <herve@elma.fr>)
List pgsql-general
On Mon, Aug 18, 2003 at 18:59:44 +0200,
  Hervé Piedvache <herve@elma.fr> wrote:
> Hi,
>
> An to be more precise what I exactly want to do :
>
> select
> case when 'now' between t.begin and t.end then t.login else 'None' end as log
> from my_table t
> order by lower(log);
>
> Is it an example more realistic for you to make an order by lower of something
> as an alias ?

You can repeat the case statement inside the lower function to do what you
want. (Assuming you didn't want 'None' to sort specially.)

pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: Hour difference?
Next
From: Steve Worsley
Date:
Subject: Re: Hour difference?