[英]Comparison between two tables inSQL
我想知道快照表中不存在哪种“类型”,但是总是会出现以下错误:-
Select * FROM
(Select type from snapshot) AS A where date = CURDATE())
LEFT JOIN
(Select type from register) AS B
ON A.type=B.type
WHERE B.type IS NULL
有人可以帮帮我吗?
这是一个有效查询的示例:
SELECT a.type
FROM snapshot a
LEFT
JOIN register b
ON b.type = a.type
WHERE a.date = CURDATE()
AND b.type IS NULL
In Standard SQL Syntax:
Select * FROM
(Select type from snapshot where date = CURDATE())AS A
LEFT JOIN
(Select type from register) AS B
ON A.type=B.type
WHERE B.type IS NULL
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.