首先,我首先阅读:MS Access - WHERE IN works, but WHERE NOT IN fails
然而,解决方案对我不起作用。我的问题是:
SELECT DISTINCT MOVIE.Movie_Num, MOVIE.Movie_Title,
MOVIE.Movie_Year, VIDEO.Movie_Num
FROM MOVIE INNER JOIN VIDEO ON MOVIE.Movie_Num = VIDEO.Movie_Num
WHERE (((MOVIE.Movie_Num) In (SELECT Movie_Num from VIDEO)));
这样可行。有一个Movie_Num没有显示在VIDEO中,因此它不会显示在查询中。
然而,当我尝试:
SELECT DISTINCT MOVIE.Movie_Num, MOVIE.Movie_Title,
MOVIE.Movie_Year, VIDEO.Movie_Num
FROM MOVIE INNER JOIN VIDEO ON MOVIE.Movie_Num = VIDEO.Movie_Num
WHERE (((MOVIE.Movie_Num) Not In (SELECT Movie_Num from VIDEO)));
当应该有记录时,它不会显示任何记录。
语法中有什么东西我不见了吗?
答案 0 :(得分:2)
您的INNER JOIN正在过滤“缺失”记录,因此where子句无关紧要。