LEFT ANTI JOIN
A LEFT ANTI JOIN, also known as a LEFT ANTI SEMI JOIN, is a type of join operation in relational databases. It is used to return all the rows from the left table that do not have a matching row in the right table.
In other words, a LEFT ANTI JOIN selects records from the left table that have no corresponding match in the right table. It is the opposite of a regular JOIN, which returns only the matching rows.
The syntax for a LEFT ANTI JOIN is as follows:
SELECT *
FROM left_table
LEFT JOIN right_table
ON left_table.column = right_table.column
WHERE right_table.column IS NULL;
In this example, the LEFT JOIN is performed on the specified column(s) between the left_table and the right_table. The WHERE clause then filters out the rows where there is a match (indicated by the right_table.column IS NULL), leaving only the rows from the left_table that have no matching row in the right_table.
The result of a LEFT ANTI JOIN is a table that contains only the rows from the left table that do not have a corresponding match in the right table
原文地址: https://www.cveoy.top/t/topic/idAq 著作权归作者所有。请勿转载和采集!