答案 0 :(得分:0)
你必须进行3次连接,并且必须重命名表locations
,因为它出现了两次:
SELECT routes.id, src.title, dest.title, groups.title FROM routes
INNER JOIN locations as src ON (src.id = routes.src)
INNER JOIN locations as dest ON (dest.id = routes.dest)
INNER JOIN groups ON (groups.id = routes.groups)