sql语句:同一张表两个相同外键查询实例分享
程序员文章站
2022-04-12 20:30:43
假设A表名称:City,B表名称:GoTo
select a.CityName as '出发地', b.CityName as '目的地',...
假设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
笔记