更新时间:2022-11-27 21:37:57
这会给你教练:
SELECT team.Teamname, person.Firstname, person.Lastname
FROM person
JOIN coach ON person.id = coach.person_id
JOIN team ON coach.team_id = team.id
这将为您提供球员:
SELECT team.Teamname, person.Firstname, person.Lastname
FROM person
JOIN player ON person.id = player.person_id
JOIN team ON player.team_id = team.id
因此,不优雅、简单的答案是将它们与 UNION
一起折腾.
So, the non-elegant, simple answer is to just toss it all together with UNION
.