我有2个表,每个表都有相同的列。让我们称之为颜色。如何比较两者以显示表B中不在表A中的独特颜色?
答案 0 :(得分:1)
select b.color
from tbl1 b
where not exists (select * from tbl2 a where b.color=a.color)
答案 1 :(得分:1)
SELECT b.color AS color FROM tableB b
LEFT JOIN tableA a ON a.color = b.color
WHERE a.color IS NULL;