insql中两个表的比较

68bkxrlz  于 2021-06-21  发布在  Mysql
关注(0)|答案(2)|浏览(298)

我想知道哪个“类型”在快照表中不存在,但总是出错this:-

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

有人能帮我吗?

azpvetkf

azpvetkf1#

下面是一个有效查询的示例:

SELECT a.type 
  FROM snapshot a
  LEFT 
  JOIN register b
    ON b.type = a.type
 WHERE a.date = CURDATE()
   AND b.type IS NULL
5n0oy7gb

5n0oy7gb2#

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

相关问题