SDO_NN the second nearest neighbor
From the docs


  sdo_num_res Specifies the number of results (nearest neighbors) to be returned. If neither sdo_batch_size nor sdo_num_res is 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: 'sdo_num_res=5'


So just set sdo_num_res to whatever number of results you want returned.