SQL for sorting boolean column as true, null, false
- by petehern
My table has three boolean fields: f1, f2, f3. If I do
SELECT * FROM table ORDER BY f1, f2, f3
the records will be sorted by these fields in the order false, true, null. I wish to order them with null in between true and false: the correct order should be true, null, false.
I am using PostgreSQL.