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

From: Joe Conway <mail(at)joeconway(dot)com>
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:34:19
Message-ID: 3F412A3B.7070602@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hervé Piedvache wrote:
> 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);
>

Try:

select log from (select case when 'now' between t.begin and t.end then
t.login else 'None' end as log from my_table t) as ss order by lower(log);

HTH,

Joe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message btober 2003-08-18 19:48:19 Re: Simulating sequences
Previous Message Tom Lane 2003-08-18 19:23:12 Re: Why lower's not accept an AS declaration ?