Oracle SQL geometry allows me to find the nearest neighbor using
SDO_NN(neighbors.GEOLOC,p.GEOLOC,'SDO_NUM_RES=1 UNIT = MILE',1) = 'TRUE')
How can I get the select the second nearest point?
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.Sign up to join this community
sdo_num_resSpecifies the number of results (nearest neighbors) to be returned. If neither
sdo_num_resis specified, this is equivalent to specifying
sdo_batch_size=0. See the Usage Notes and Examples for more information. Data type is
NUMBER. For example:
So just set
sdo_num_res to whatever number of results you want returned.