I have three tables : Table a
UID
SellID
BuyID
SAMonth
Table B
ID
ZipCode
Table C
Zip Code
Latitude
Longitude
Now i have to find distance between two ID's
Firstly i was having UID and based on that UID i tried to get two Zip code Corresponding to each ID using following code.
Select t1.UID,t1.SellID,z1.ZipCode, t1.BuyID, z2.ZipCode , SAMonth
from tableA t1
inner join tableB z1 on t1.SellID Like z1.ID
inner join tableB z2 on t1.BuyID Like z2.ID
where Criteria
what is wrong in this code, i am getting Syntax error in this when i am adding second inner join. Also how to use this Zip to get latitude and longitude for both ID's
It is working with Like Keyword because of the difference of Format. After adding brackets its working. How Can it be extended to 3rd table