tuanbs

tuanbs

  • NA
  • 23
  • 103.8k

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

Nov 18 2009 12:23 PM
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)