Comments on: Set Theory in MySQL 8.0: UNION and Now INTERSECT and EXCEPT https://www.percona.com/blog/set-theory-in-mysql-8-0-union-and-now-intersect-and-except/ Fri, 16 Feb 2024 21:18:59 +0000 hourly 1 https://wordpress.org/?v=6.5.2 By: Corrado Pandiani https://www.percona.com/blog/set-theory-in-mysql-8-0-union-and-now-intersect-and-except/#comment-10973810 Fri, 04 Nov 2022 11:19:09 +0000 https://www.percona.com/blog/?p=83283#comment-10973810 Yes, the equivalence looks good. Intersect drops duplicates while the join can return duplicates. You should add DISTINCT.

NULLs are handled differently. Intersect returns NULL if rows match, while the join does not.

]]>
By: Ross https://www.percona.com/blog/set-theory-in-mysql-8-0-union-and-now-intersect-and-except/#comment-10973804 Wed, 02 Nov 2022 13:44:49 +0000 https://www.percona.com/blog/?p=83283#comment-10973804 Nice clear example. Pics help a lot. Thanks.

Safe to say, intersect is to inner join as union is to union all? (or maybe null handling differs?)

]]>