Re: order by date desc but NULLs last

From: "Ross J(dot) Reedstrom" <reedstrm(at)rice(dot)edu>
To: Jean-Luc Lachance <jllachan(at)nsd(dot)ca>
Cc: "A(dot)M(dot)" <agentm(at)cmu(dot)edu>, pgsql-sql(at)postgresql(dot)org
Subject: Re: order by date desc but NULLs last
Date: 2003-02-10 18:52:44
Message-ID: 20030210185244.GA16454@wallace.ece.rice.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Mon, Feb 10, 2003 at 01:32:54PM -0500, Jean-Luc Lachance wrote:
> Why not try the obvious first?

Because it's not always obvious ;-) Yup, if you want two kinds of order
(NULLs last, descending dates), use two order by clauses.

> order by gradedtime is null, gradedtime desc;
>
> "Ross J. Reedstrom" wrote:

<a different, less elegant way to get the NULLs last>

Ross

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2003-02-10 19:03:43 Re: problems with date and interval queries.
Previous Message Jean-Luc Lachance 2003-02-10 18:32:54 Re: order by date desc but NULLs last