在 Pascal 中连接 2 条记录的最佳方式是什么?

发布于 2024-08-17 16:53:21 字数 127 浏览 4 评论 0原文

我对 Pascal 中的记录有一点问题。我正在编写一个程序,其中有两个记录列表:一个是患者,第二个是疾病,但我不知道如何加入它。我试图在患者列表中制作一个包含疾病 ID 的动态表,但拉扎勒斯在编译它时遇到了问题。如果有人帮助我,我会很高兴。

I've a little problem with records in Pascal. I'm writting a program where I've got two lists of records: one with patients and second with diseases but I don't have idea how to join it. I was trying to do a dynamic table with diseases id's in patient list but lazarus had problems with compiling it. I would be glad if someone helps me.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

怀念你的温柔 2024-08-24 16:53:21

一名患者可以患有多种疾病,许多患者可以患有一种疾病。

如果有关患者的记录描述了患者(例如出生日期)
有关疾病的记录描述了疾病(例如死亡发生率)
那么您需要关于每个患者的每种疾病病史的第三个记录列表(例如康复日期)。

使用 Patientid 作为指导,将第三个记录列表链接回患者,并使用疾病 ID 作为指导,将其链接回疾病。

现在您必须进行三向联接才能将所有相关信息放在一起。

如果我必须这样做,我会使用 SQL 而不是 Pascal。但还有使用数据库的开销。

One patient can have many diseases, and many patients can have one disease.

If records about patients describe patients (e.g. Date of Birth)
and records about diseases describe diseases (e.g. incidence of fatality)
then you need a third list of records about each patient's history with each disease (e.g. date of recovery).

It's not hard to link this third list of records back to patients, using patientid as the guide, and back to diseases, using diseaseid as the guide.

Now you have to do a three way join in order to get all the related information together.

If I had to do this I would use SQL rather than Pascal. But then there's the overhead of uisng a database.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文