我从附加模式中的查询要求我寻找测试呈阳性的人去的相同位置,并且与未测试的人在同一个人中。(未测试表示测试表中不存在的人。
--find the same locations of where the positive people and the untested people went
select checkin.LocID, checkin.PersonID
from checkin join testing on checkin.personid = testing.personid
where results = 'Positive'
and (select CheckIn.PersonID
from checkin join testing on checkin.PersonID = testing.PersonID where CheckIn.PersonID
not in (select testing.PersonID from testing));
在我看来,查询说明了以下内容
从加入检查和测试表中选择一个位置和人员,结果是肯定的,并从检查表中选择一个人,而不是在测试表中。
由于我得到的答案是零,而且我手动知道有人。我究竟做错了什么?
我希望这是有道理的。