SQL SEMI and ANTI Joins

preview_player
Показать описание
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.

---------------------------------------------------

This is part of the Everything About Joins playlist, available at:

The written version of this content is also available at:

---------------------------------------------------

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
Рекомендации по теме
Комментарии
Автор

Both DuckDB and ClickHouse support explicit SEMI/ANTI joins:


While DuckDB implements SEMI/ANTI as a new join type (alongside LEFT, RIGHT, FULL, etc), ClickHouse implements SEMI/ANTI as a new join scope (alongside INNER, OUTER, etc)

Bilbottom
Автор

this was insanely good! thank you so much. now i finally understand what these joins are. duckdb rocks!

michalbotor