我有一个名为 INVOICE 的表,来自我获得 ADDRESSID 的位置
我有另一个名为 Address 的表
ADDRESSID ADDRESS
2 BB
2 BC
并且 CC 和 BC 的值在另一个名为 ADDRESSVALUE 的表中,基于 ADDRESSID
ID CODE VALUE
1 BB BlindFold
2 BC Bucharest
现在我使用内部连接查询表
SELECT AC.VALUE AS ADDRESS
FROM ADDRESS AS OT
INNER JOIN INVOICE AS OM ON OM.ADDRESSID = OT.ADDRESSID
INNER JOIN ADDRESSVALUE AS AC ON OT.ADDRESS = AC.CODE
WHERE OM.ADDRESSID = 2
我得到的结果是
Blindfold
Blindfold
但应该是
BlindFold
Bucharest