Nulls Last, Nulls First
Postgres query sorting has a great feature,nulls first
/nulls last
, that helps us specify where in a query result null values appear.
Nulls in Postgres are sorted as larger than any other value, so this is a descending sort containing null values (💀 == null):
Reverse the null position with nulls last
:
Here's the opposite query, ascending:
Now, reverse the null position with nulls first
:
Lots of ways to explore our data.
Tweet