如何使用“不在”在MS Access? [英] How to use "not in" in MS Access?

查看:75
本文介绍了如何使用“不在”在MS Access?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,

我有一个MS Access数据库,我正在处理两个表,其中包括CustomerMaster和PMReg表中的客户名称和预订日期字段。



我想只显示那些不在PMReg表中的客户名称。

注意:两个表中都存在客户名称。



我的查询是:

Hi friends,
I have a MS Access database and i m working on two tables which include the fields Customer name and Booking date from CustomerMaster and PMReg table.

I want to display only those customer names who are not in PMReg table.
Note: In both table customer names exists.

My query is:

select a.customer from CustomerMaster as c,PMReg as p where a.active=p.active
and a.customer not in (select customer from PMReg)

推荐答案

您不能使用not in进行访问。但你可以使用连接并检查空值。

从这里查看更多细节



查找存在于一个表中但不存在于查询中的记录
you can not use "not in" for access. but you can use joins and check nulls value.
See more detail from here

Finding records that exist in one table but not a query


这篇关于如何使用“不在”在MS Access?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆