MS Access 2007在多个字段上的加入 [英] MS Access 2007 JOIN on Multiple Fields

查看:117
本文介绍了MS Access 2007在多个字段上的加入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个类似于以下内容的表:

I have a two tables similar to the following:

我正在尝试在Access中创建一个查询来创建一个像这样的表:

I am attempting to create a query in Access to create a table like this:

关键在于,JOIN必须同时与Date和Name字段匹配.我可以将T2的字段加入T1.

The crux of course is that the JOIN must match against both the Date and Name fields. I can join the fields from T2 into T1.

在日期和名称上同时联接字段的正确语法是什么(在SQL中还是通过查询设计器)?

What is the proper syntax (either in SQL or via the query designer) to join the fields on both Date and Name?

我的尝试重复了字段计数.

My attempts have duplicated the field count.

推荐答案

使用查询设计窗口,将T1中的Date拖到与T2中的Date匹配,同样,将Name从T1拖到T2.这将为您提供有关生物名称和日期的内在联接.切换到SQL视图以查看SQL.

Using the query design window, drag Date from T1 to match Date in T2 and similarly, drag Name from T1 to T2. This will give you an INNER JOIN on bioth name and date. Switch to SQL view to view the SQL.

顺便说一句,名称和日期均为保留字.尤其是,在MS Access中调用名称是一件很糟糕的事情,因此我希望这些都是虚构的字段(列)名称.

BTW, both Name and Date are reserved words. Name in particular is a terrible thing to call anything in MS Access, so I hope these are imaginary field (column) names.

这篇关于MS Access 2007在多个字段上的加入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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