同一张表的2个外键对应同一个主键!多表查询问题????

2024-12-05 06:55:20
推荐回答(1个)
回答1:

假设A表名称:City,B表名称:GoTo
select a.CityName as '出发地', b.CityName as '目的地', c.LeaveDate as '出发时间'
from City as a, City as b, Goto as c
where c.FromCity = a.CityID
and c.ToCity = b.CityID