SQL语句理解 select * from B where (select count(1) as num from A where A.ID = B.ID) = 0select * from B where (select count(1) as num from A where A.ID = B.ID) = 0请问如何理解,为什么 可以在B表中 排除A表的数据

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/25 10:46:21
SQL语句理解 select * from B where (select count(1) as num from A where A.ID = B.ID) = 0select * from B where (select count(1) as num from A where A.ID = B.ID) = 0请问如何理解,为什么 可以在B表中 排除A表的数据
x) y~'XX85'5DAK!(?WI<#(UA*_WaXW QU`4z~.kzw*ġ:Ovz^t  W<ٱVYߤ38ygͣv6#+l X|z:lɔ./{ַhߋ=@+Q  :xݼ}:jX$ف }M

SQL语句理解 select * from B where (select count(1) as num from A where A.ID = B.ID) = 0select * from B where (select count(1) as num from A where A.ID = B.ID) = 0请问如何理解,为什么 可以在B表中 排除A表的数据
SQL语句理解 select * from B where (select count(1) as num from A where A.ID = B.ID) = 0
select * from B where (select count(1) as num from A where A.ID = B.ID) = 0
请问如何理解,为什么 可以在B表中 排除A表的数据

SQL语句理解 select * from B where (select count(1) as num from A where A.ID = B.ID) = 0select * from B where (select count(1) as num from A where A.ID = B.ID) = 0请问如何理解,为什么 可以在B表中 排除A表的数据
子查询中select count(1) as num from A where A.ID = B.ID
就是统计B表和A表用ID连接的行数
子查询的行数=0,就可以实现从B表中排除A表数据