Snowflake SQL Patterns
Independent cookbook

Snowflake SQL Patterns

Worked SQL recipes and the footguns official reference pages leave out.

This is a small, independent cookbook of SQL patterns that come up constantly in warehouse work: latest-per-key filters, nested JSON, MERGE upserts, clustering, Time Travel, timestamps, and file loads.

It is not a second copy of the Snowflake function reference. Official docs are linked from every page and remain the authority. What each page adds is a concrete problem, a working example, the gotcha that usually bites, and when not to use the pattern.

Where a query could be run in DuckDB (which implements QUALIFY, UNNEST, and MERGE), it was executed in DuckDB 2.0.0 while this site was built. Snowflake-only syntax is labeled as verified against official documentation and not executed on Snowflake.