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

From Joe Conway
Subject Re: Why lower's not accept an AS declaration ?
Date
Msg-id 3F412A3B.7070602@joeconway.com
Whole thread Raw
In response to Re: Why lower's not accept an AS declaration ?  (Hervé Piedvache <herve@elma.fr>)
List 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


pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Why lower's not accept an AS declaration ?
Next
From:
Date:
Subject: Re: Simulating sequences