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

From: Bruno Wolff III <bruno(at)wolff(dot)to>
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 18:59:13
Message-ID: 20030818185913.GA2816@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Aug 18, 2003 at 18:59:44 +0200,
Hervé Piedvache <herve(at)elma(dot)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.)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2003-08-18 19:01:39 Re: Hour difference?
Previous Message Stephan Szabo 2003-08-18 18:58:10 Re: Why lower's not accept an AS declaration ?