SELECT COUNT(*) FROM A WHERE OBJECTID IN (SELECT OBJECTID FROM B ) ;
在上面的脚本中,B表中并不存在OBJECTID ,但是执行没有报错。
折腾了一通,似乎等价于:
SELECT COUNT(*) FROM A WHERE OBJECTID = OBJECTID ;
SELECT COUNT(*) FROM A WHERE OBJECTID IN (SELECT ID FROM B ) ;
OBJECTID ID 都只存在于A表中,B 表中不存在
等价于:
SELECT COUNT(*) FROM A WHERE OBJECTID = ID ;
阅读(799) | 评论(0) | 转发(0) |