pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ross J. Reedstrom <reedstrm@rice.edu>
To: Jean-Luc Lachance <jllachan@nsd.ca>
Cc: A.M. <agentm@cmu.edu>
Cc: pgsql-sql@postgresql.org
Subject: Re: order by date desc but NULLs last
Date: Mon, 10 Feb 2003 12:52:44 -0600
Message-ID: <20030210185244.GA16454@wallace.ece.rice.edu> (raw)
In-Reply-To: <3E47F056.DE8707E2@nsd.ca>
References: <F427C52A-3C7D-11D7-A094-0030657192DA@cmu.edu>
	<20030209231204.GB11550@wallace.ece.rice.edu>
	<3E47F056.DE8707E2@nsd.ca>

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




view thread (5+ messages)

Message-ID: <20030210185244.GA16454@wallace.ece.rice.edu>
Permalink:  ../20030210185244.GA16454@wallace.ece.rice.edu/
Also on:    postgresql.org/message-id/20030210185244.GA16454@wallace.ece.rice.edu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: reedstrm@rice.edu, jllachan@nsd.ca, agentm@cmu.edu
  Subject: Re: order by date desc but NULLs last
  In-Reply-To: <20030210185244.GA16454@wallace.ece.rice.edu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox