I have a table of airport pairs, likeORIGIN DESTINATIONJFK SFOSFO JFKMCO JFKORD SFO
etc. There are a few hundred thousand, so speed is an issue with this question. I'd like to join that to another table with lat/long locations, which looks likeAIRPORT LAT LONGJFK 101.3 57.2SFO 52.1 110.1 (obviously these aren't accurate)
So that my results areJFK 101.3 57.2 SFO 52.1 110.1
for each line in the first table of pairs.I can JOIN one of the airport codes to its coordinates, but how do I end up with results for both pairs like above?