我有三个表,分别是目的地、位置和意图。 他们彼此之间存在以下关系。我正在尝试获取给定意图的位置及其相应的目的地。 但我目前无法做到这一点。 有什么想法吗?
例如:获取“徒步旅行”意图的位置名称及其对应的目的地
查询失败:
select destination.name,location.name from location,destination,intention where
intention.name='hiking' AND location.destination_id=destination.destination_id AND
intention.intention_id=location.intention_id
最佳答案
位置表中不存在徒步旅行的intent_id 1,因此没有返回行
关于mysql查询引用三个表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46996436/