SQL ASOF Join (DuckDB, Snowflake)
The ASOF join is great for joining data on misaligned timestamps, hence why I think of it as the "timestamp" join. Of the databases that I use, only DuckDB and Snowflake support ASOF as a keyword. If you use another database that supports ASOF, let me know in the comments! - https://duckdb.org/docs/sql/query_syntax/from#as-of-joins - https://docs.snowflake.com/en/sql-reference/constructs/asof-join --------------------------------------------------- This is part of the Everything About Joins playlist, available at: - https://www.youtube.com/playlist?list=PLEiRgvTilK5rJilO6gc809Eg2Qajgeh02 The written version of this content is also available at: - https://billwallis.github.io/sql-learning-materials/everything-about-joins/syntax/timestamp-joins/ --------------------------------------------------- CHAPTERS 00:00 Intro 01:12 The ASOF join 05:32 ASOF in Snowflake 08:46 Syntax rules: extra join conditions 10:26 Syntax rules: USING 12:39 Other examples 14:29 Alternatives to ASOF: lateral join 17:46 Alternatives to ASOF: ROW_NUMBER 20:38 Wrap up
Download
0 formatsNo download links available.