I have two tables. Table A structure is
City | State | Country | Latitude | Longitude | LocPoint(Longitude,Latitude)(spatial index)
I have created spatial index on column LocPoint of datatype Point.
Table B
Latitude | Longitude
I want to Join two tables A and B with City State and Country information of the nearest city to the location of points in table B. I know the formula of getting the nearest point, I am just stuck at the join part where i will join only for the nearest point.
Expected OutPut after running the query
Latitude(TableB) | longitude(TableB)| City(Nearest from lat/Lon from Table A) | State | Country
Any ideas?