1
Answer

A problem with 1 table has 2 foreign key with other table. Help me.

tuanbs

tuanbs

15y
2.4k
1
I have 2 tables. Mail and Branch. Tbl Mail include fields: MailCode(PK), FromBranch(FK), ToBranch(FK). Tbl Branch include fields: BranchCode(PK), ZipCode. Fileds FromBranch and ToBranch is FK with BranchCode. Now I wannt to show FromBranch and ToBranch by ZipCode of table Branch. I try query: "select ZipCode As [From Zip Code], ZipCode As [To Zip Code] from Mail As M, Branch As B where B.BranchCode = M.ToBranch and B.BranchCode = M.FromBranch". But it doesn't work. Help me. Thanks
Answers (1)