Read the functional manual (RTFM)
Snowflake’s technical documentation is among the clearest and most informative I have ever encountered (virtual columns aside). Paying attention to the usage notes and best practices or simply scrolling down the list of available functions helped me elevate my SQL game and discover new features when I first started, and it continues to pay dividends. One such discovery came—putting aside pride—while reading the usage notes for ORDER BY
(https://docs.snowflake.com/en/sql-reference/constructs/order-by). There, I learned about the NULLS FIRST
and NULLS LAST
keywords and how they override the default ordering of NULL
when arranging in ASC
or DESC
. It’s a feature that has come in handy many times since. Most importantly, it serves as a reminder to check the documentation periodically to help spot new features and functionality.
See the example in the file titled 03_order_by_nulls.sql
.