SELECT A.NAME, A.LAST_NAME
FROM TABLEA A
LEFT JOIN TABLEB B
ON A.NAME = B.NAME AND A.LAST_NAME=B.LAST_NAME
WHERE B.NAME is null and B.LAST_NAME is null;
select
concat(first_name, ' ', last_name) as full_name
from TableA
having full_name not in (
select
concat(first_name, ' ', last_name) as full_name
from TableB
);
4条答案
按热度按时间lh80um4z1#
这也会起作用:
z18hc3ub2#
一个简单的左连接就足够了。当您对name和last name进行左连接,并且b.name为null时,这意味着该记录在表a中,而不是在表b中。
k5ifujac3#
使用以下给定的查询来获得所需的结果:
q43xntqr4#
试试这个: