SQL SEMI and ANTI Joins
The SEMI and ANTI joins are great for filtering data based on the existence of data in another table. Confusingly, SEMI and ANTI joins aren't really "joins". There's a traditional way of implementing SEMI/ANTI joins that all databases will support, and a few databases (like DuckDB!) actually provide SEMI/ANTI join types to make the SQL a little more friendly. - https://duckdb.org/docs/sql/query_syntax/from.html#semi-and-anti-joins --------------------------------------------------- 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/filtering-joins/ --------------------------------------------------- CHAPTERS 00:00 Intro 01:12 Sample data 01:48 Problem statement 02:14 Filtering with WHERE ... IN 03:50 Filtering with WHERE EXISTS 07:19 DuckDB Syntax 10:35 Wrap up
Download
0 formatsNo download links available.