title: pl/sql code for nearest neighbor query without index for a table with point data in oracle
body: <p>i am trying to build a procedure to obtain k nearest neighbor points to a point with a selected ID. 
  I need to do this without using any spatial locator features like sdo_geometry or nn. </p>
  
  <p>basically i have a table in oracle with ID, Data_X, Data_Y. let's say i have 10 entries in my table, and i need the 3 nearest points to a fictional point target_x,  target_y. </p>
  
  <p>we would need to calculate the euclidean distance of  each point in the table with my given fictional point. I just dont know an algorithm in pl/sql that would return me the nearest neighbor ids.</p>