我被困在下面的查询中,我需要列出来自不同表的两个属性。有没有更简单的方法来编写上述查询?
Tables:
Patient (PatientID, FamilyName, GivenName,Address)
Item (ItemNo, Info, Fee)
Account (AccountNo, PatientID, Date)
AccountLine (AccountNo, ItemNo)
列出任何名为 John Wayne 的患者的项目信息和所有治疗日期:
Select FamilyName =” Wayne” and GivenName=”John” (Patient)> Temp1
Temp1*Temp1.PatientID = Account.PatientID (Account) > Temp2
- Updated
Temp2*Temp2.AccountNo = AccountLine.AccountNo (Temp2 X Account) >Temp3
Temp3*Temp3.ItemNo = Item.ItemNo (Temp3x Item) > Temp4
Select Description, Date(Temp4)
Join Answer
Select Description, Date (Restrict FamilyName =” Wayne” and GivenName=”John” (Patient) Join Account Join Item Join AccountLine)