困难的交叉表查询

困难的交叉表查询

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

问题描述

在开发一个相对复杂的关系数据库时,自己陷入了困境.

Tied myself a bit up in knots in the development of a relatively complicated relational database.

数据库的用途是允许管理人员安排与特定公司的代表(或代表组)的会议.

Purpose of database is to allow managers to arrange meetings with representatives (or groups of representatives) from particular companies.

自然地,表格概述了与已安排的会议有关的细节,这一点至关重要.不幸的是,由于字段仅返回其他表的数字字段,因此用户几乎无法解析其大多数信息.

Naturally the table, outlining the details relating to arranged meetings, is of utmost importance. Unfortunately most of its information is nigh impossible for users to parse as the fields are merely returning the numerical fields of other tables.

所以我真正需要的是能够创建一个查询,该查询将所有这些不同的信息收集到一起,并与会议密钥相关联,并允许用户以表格形式输入所有相关信息,以便进行...合理地安排这样的约会.

So really what I need, to be able to create a query that will gather all this diverse information together, tied to the meeting key, and allow users to enter in all the relevant information in a form for... well arranging such appointments.

这是原理图(一些不相关的信息被隐藏了)

Here's the schematic (some irrelevant info is hidden)

(是我的想象还是png异常小?)

(is it my imagination or is the png unusually small?)

我当时正在考虑制作很长的SELECTS和INNER JOINS系列.

I was thinking of producing a very long series of SELECTS and INNER JOINS. Something like

SELECT Meeting.MID, Meeting.Date_dd/mm/yyyy, Meeting.Location, Contact.Cname, Contingent.Manager [...]
FROM Meeting INNER JOIN (ContactMeeting INNER JOIN (Contact INNER JOIN [...]

但是我担心,因为它们之间的关系不是线性的. ContactMeeting分支到Contact,Group_contact和Contingent;在这种情况下INNER JOINS可能不起作用. ContactMeetings可能有一个Contact或一个Group_contact,或者两者都存在(包括或不包括),但是总是会存在一个或有的礼物(由一个或多个经理组成).

But I am concerned because the relations are not linear; ContactMeeting branches off to Contact, Group_contact, and Contingent; that INNER JOINS in this instance may not work. ContactMeetings may have either a Contact, a Group_contact, or both present (inclusive or), but will always have a Contingent present (which will consist of one or more managers).

与此有关的帮助将不胜感激!

Help in relation to this would be much appreciated!

推荐答案

对于更漂亮的子表单,可以为要包含在子表单控件中的表单设置一些表单属性.您需要在设计视图中打开(子)表单.

For prettier subforms, you can set some form properties for the form to be contained by the subform control. You need to open the (sub) form in design view.

这篇关于困难的交叉表查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 07:52