多对多访问 [英] Many to Many in Access

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

问题描述

我试图摆脱现实世界中的多对多关系(并且由于无法做到而感到愚蠢)或找到将其输入到Access中的正确方法.我尝试了几种联结表设置,但似乎只将多对多问题传递给了另一个表.

I'm trying to ether get rid of a real world many-to-many relationship (and just feeling stupid for not being able to) or find the proper way to input it into Access. I've tried several junction table setups and only seem to pass the many-to-many problem on to another table.

这是两个表的缩写示例:

Here is an abbreviated sample of the two tables:

表1:

Amp_Number      Amp_S.Name
103             Rag1
194             Osd4
230             Lew6
321             Ooi4
550             Qwd3
629             Crd5
687             Rab4
879             Pra2

表2:

Plas_Number         Plas_Amp
55                  Rab4
82                  Osd4 & Qwd3 & Lew6
94                  Rab4 & Rag1 & Ooi4
102                 Ooi4 & Lew6
125                 Pra2 & Rag1 & Crd5
142                 Qwd3 & Ooi4 & Rag1
146                 Lew6 & Osd4 & Rab4
154                 Rab4 & Lew6 & Ooi4

推荐答案

您需要一个将Plas_Number映射到Amp_Number的联结表,该表可以具有一个或多个表1或表2的记录.

You need a junction table mapping the Plas_Number to Amp_Number, which can have one or more records for either Table 1 or Table 2:

表1:

Amp_Number      Amp_S.Name
103             Rag1
194             Osd4
230             Lew6
321             Ooi4
550             Qwd3
629             Crd5
687             Rab4
879             Pra2

表2:

Plas_Number
55
82
94
102
125
142
146
154

连接表:

Plas_Number    Amp_Number
55             687
82             194
82             550
82             230
etc.

  • 表1和连接表之间存在一对多的关系
  • 表2和连接表之间存在一对多的关系
  • 这篇关于多对多访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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