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

2024年12月05日 06:55
有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