我有两张桌子,如下所示
location_distance
----------------------------------------------
id | fromLocid | toLocid | distance
----------------------------------------------
1 | 3 | 5 | 70
2 | 6 | 8 | 15
3 | 2 | 4 | 63
...
Run Code Online (Sandbox Code Playgroud)
other_table
--------------------------------------------
Id | fromLocid | toLocid | otherdata
--------------------------------------------
12 | 5 | 3 | xxxx
22 | 2 | 4 | xxxx
56 | 8 | 6 | xxxx
78 | 3 | 5 | xxxx
Run Code Online (Sandbox Code Playgroud)
我想检索b/w中每行的other_table中的位置的距离.这是我尝试过的
SELECT ot.*, ld.distance FROM other_table AS ot
INNER …Run Code Online (Sandbox Code Playgroud)