Re: Making NULL entries appear first when ORDER BY ASC - Mailing list pgsql-sql

From Greg Sabino Mullane
Subject Re: Making NULL entries appear first when ORDER BY ASC
Date
Msg-id 1a4e31bde16a440691d672a49fc080de@biglumber.com
Whole thread Raw
In response to Making NULL entries appear first when ORDER BY ASC  (Andreas Joseph Krogh <andreak@officenet.no>)
List pgsql-sql
-----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-----




pgsql-sql by date:

Previous
From: Ragnar Hafstað
Date:
Subject: Re: Making NULL entries appear first when ORDER BY
Next
From: Bruno Wolff III
Date:
Subject: Re: Making NULL entries appear first when ORDER BY ASC