pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Sabino Mullane <greg@turnstep.com>
To: pgsql-sql@postgresql.org
Subject: Re: Making NULL entries appear first when ORDER BY <field> ASC
Date: Wed, 16 Feb 2005 04:08:30 -0000
Message-ID: <1a4e31bde16a440691d672a49fc080de@biglumber.com> (raw)
In-Reply-To: <200502160055.59288.andreak@officenet.no>


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



> Now, as you see, touples with NULL in the "start_time"-field
> appear "after" the others. I would like to make all entries
> where start_time IS NULL apear *before* all the others.

ORDER BY start_date, CASE WHEN start_time IS NULL THEN 0 ELSE 1 END, start_time

- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200502152309
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8

-----BEGIN PGP SIGNATURE-----

iD8DBQFCEseYvJuQZxSWSsgRAlipAJwKAyqAyLbo9hfpoWkz0SOlTY3feACfa+ng
DqNY4DAJ5TeeGQbI+smNilg=
=LRhP
-----END PGP SIGNATURE-----





view thread (10+ messages)  latest in thread

Message-ID: <1a4e31bde16a440691d672a49fc080de@biglumber.com>
Permalink:  ../1a4e31bde16a440691d672a49fc080de@biglumber.com/
Also on:    postgresql.org/message-id/1a4e31bde16a440691d672a49fc080de@biglumber.com

 · 

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: greg@turnstep.com
  Subject: Re: Making NULL entries appear first when ORDER BY <field> ASC
  In-Reply-To: <1a4e31bde16a440691d672a49fc080de@biglumber.com>

* 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