0
我有三个表,它们是目的地,位置和意图。 他们与彼此有以下关系。我正在尝试为给定意图获取位置及其相应的目的地。 但我目前没有做到这一点。 任何想法?引用三个表的mysql查询
例如:获取地点名称和 '徒步旅行' 的意图
无法查询其对应的目标:
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
你的查询语法,虽然不尽如人意,实际上看起来像它应该工作。你目前的产出是多少? –
我收到一个空的答复。有记录可以满足这个条件。 –
无处不在使用明确的左连接。 –