With the latest MySQL release (8.0.31), MySQL adds support for the SQL
standard INTERSECT and EXCEPT table operators.
Let’s have a look how to use them.
We will use the following table:
CREATE TABLE `new` (
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(20) DEFAULT NULL,
`tacos` int DEFAULT NULL,
`sushis` int DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB
For our team meeting, we will order tacos and sushi’s.
Each record represent the order of each team member:
select * from new;
+----+-------------+-------+--------+
| id | name | tacos | sushis | …[Read more]