MS Access 选择相关行
我有 2 个具有多对任意关系的表。在这个例子中,我们将表称为“Guys”和“Girls”。有一个联结表,其中包含相关的主键...谁与谁约会过。
如果我想找到 Guy 1 约会过的所有女孩,我会执行以下操作:在连接表上选择所有带有 girls.ID 的女孩。现在要查找女孩的姓名,我需要使用每个记录集行中的键从女孩表中选择一行
。因为我已经定义了关系,所以更简单? Access 我认为必须有一种方法来构建单个查询,我该怎么做?
I have 2 tables with a many-to-any relationship. For the example we will call the tables "Guys" and Girls" There is a junction table that contains the related primary keys...who has dated who.
If I want to find all the girls that Guy 1 has dated, I do a select on the junction table selecting all girls with guys.ID. This give me a RecordSet. Now to find the names of the girls, I need to select from the girls table a row using the key from each RecordSet row.
Isn't there an easier way? Since I've defined the relationships in Access I would think that there must be a way to build a single query. How do I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)