我在编写此特定任务的查询时遇到问题。以下是简化表:
`job`: job_id, school_id
`school`: school_id, country_id
`country`: country_id, region_id
`region`: region_id, region
现在,我查询job
表以获取职位列表,但我还需要显示每个职位的区域(即欧洲,亚洲等)
如何提供这些链接表?
答案 0 :(得分:1)
从您提供的内容看起来像这样:
select
*
from `job` j
inner join `school` s on j.school_id = s.school_id
inner join `country`c on s.country_id = c.country_id
inner join `region` r on c.region_id = r.region_id
但我认为学校表应该包含地区,或国家和地区。