How to use MAX_BY and MIN_BY in Snowflake (and DuckDB, BigQuery, Databricks) to replace messy self-joins and windows when getting latest or top-N values per group.
ASOF JOINs are the most efficient way to relate the timestamp of one table with the timestamp of another table, even when those timestamps don't match exactly.
Feel free to skip