我有两个这样定义的表。表位置用于存储地址
locations
---------
id
addr
city
zip
name
另一个表引用两个位置地址存储在每个条目的位置表中是这个
packages
---------
id
client_id
pick_id <-- this id is for the location address for pick
drop_id <-- this id is for the location address for drop
我想回来
location.name, location.addr, location.city, location.id for pick
location.name, location.addr, location.city, location.id for drop
对于给定的 client_id
我目前有这个 sql
Select
packages.status,
locations.name,
locations.address,
locations.zip,
locations.city,
locations.id
From
packages Inner Join
locations On packages.drop_id = locations.id And packages.client_id = 5
但我得到空行的结果。谁能指出我的错误?