Re: CASE in ORDER BY clause

From: Louis-David Mitterrand <vindex+lists-pgsql-general(at)apartia(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: CASE in ORDER BY clause
Date: 2007-07-07 08:29:40
Message-ID: 20070707082940.GA8222@apartia.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jul 06, 2007 at 08:02:54PM +0400, Viatcheslav Kalinin wrote:
> Louis-David Mitterrand wrote:
>
> # select start_date from show_date
> # order by
> # case when start_date > CURRENT_DATE then start_date end desc,
> # case when start_date <= CURRENT_DATE then start_date end asc;

But... this works!

Many thanks,

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Louis-David Mitterrand 2007-07-07 08:37:12 Re: CASE in ORDER BY clause
Previous Message Zlatko Matic 2007-07-07 07:44:04 Re: Update a single row without firing its triggers?