最强狂暴修仙txt下载:visual foxpro 嵌套查询 为什么记录总数不等 如何解决?

来源:百度文库 编辑:神马品牌网 时间:2024/04/30 00:44:03
select * from zb where 姓名 not in (select distinct 姓名 from jbxx) 得 569条记录
select * from zb where 姓名 in (select distinct 姓名 from jbxx)
得 733条记录
569+733=1302条记录
但是zb 的记录总数 只有1287条按照道理两个总数应相等啊(zb表中的姓名有重复,jbxx 表中的姓名也有重复)?百思不得其解
请高手帮忙,谢谢!

为什么啊这是

select count(*) from zb group by 姓名

你应该会发现是1287条记录

select count(*) from zb where 姓名 not in (select 姓名 from jbxx)
select count(*) from zb where 姓名 in (select 姓名 from jbxx)
这样试试看