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

From: Ian Barwick <barwick(at)gmx(dot)net>
To: Hervé Piedvache <herve(at)elma(dot)fr>, 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 20:15:07
Message-ID: 200308182215.07841.barwick@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Monday 18 August 2003 18:59, Hervé Piedvache 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);

How about something like:

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

Ian Barwick
barwick(at)gmx(dot)net

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2003-08-18 20:22:43 Re: Default Value in Table Setup Help
Previous Message Darko Prenosil 2003-08-18 20:09:19 Re: Why lower's not accept an AS declaration ?