如何选择一个表中所有未出现在另一表中的行?
表格1:
+-----------+----------+------------+
| FirstName | LastName | BirthDate |
+-----------+----------+------------+
| Tia | Carrera | 1975-09-18 |
| Nikki | Taylor | 1972-03-04 |
| Yamila | Diaz | 1972-03-04 |
+-----------+----------+------------+
表2:
+-----------+----------+------------+
| FirstName | LastName | BirthDate |
+-----------+----------+------------+
| Tia | Carrera | 1975-09-18 |
| Nikki | Taylor | 1972-03-04 |
+-----------+----------+------------+
表1中不在表2中的行的示例输出:
+-----------+----------+------------+
| FirstName | LastName | BirthDate |
+-----------+----------+------------+
| Yamila | Diaz | 1972-03-04 |
+-----------+----------+------------+
也许这样的事情应该工作:
SELECT * FROM Table1 WHERE * NOT IN (SELECT * FROM Table2)