Here's something I found out about the ORDER BY clause in BigQuery SQL the other day.
Check out the NULLS FIRST / NULLS LAST clauses. What do they do? They control how to treat NULL values when sorting.
While these are entirely optional, they're actually already happening behind the scenes even if you don't specify them.
๐น ORDER BY [column] ASC (which is the default) uses NULLS FIRST if unspecified
๐น ORDER BY [column] DESC uses NULLS LAST if unspecified
Found it useful? Subscribe to my Analytics newsletter at notjustsql.com.
ย