访问左联接无法正常工作 [英] Access Left Join not working properly

查看:75
本文介绍了访问左联接无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在访问中,我编写了以下查询:

In access I wrote this query:

Select
  I.sysid, I.MemberNumber, I.Date, I.Distributer,
  F.MemberNumber as FMember, F.Date as FDate, I.Distributer as FDistributer
From Initial as I
Left Join Final as F ON
  I.MemberNumber=F.MemberNumber and
  I.Distributer=F.Distributer and
  I.Date>=F.Date-14 and
  I.Date<=F.Date+14;

但是左联接行为不正确.该表中的行少于初始表中的行,但是它应该使所有行都保持初始状态,因为我使用的是左联接,对吗?我发现初始行中没有几行(例如sysid = 7,这是Initial的键).

But the left join is not behavior properly. There are fewer rows in this table then there are in Initial... but it should be keeping ALL rows from initial, because I am using a left join, right? I have found several rows in initial (like sysid=7, which is Initial's key) that just isn't coming into this table.

推荐答案

尝试将其他字段添加到原始表中,并使用更新查询添加其他列.这样,您可以确定不会删除任何列.

Try adding additional fields to the original table and using update queries to add extra columns. This way you can be sure you won't drop any columns.

这篇关于访问左联接无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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