Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vmleon/cebf3304be6d5685caa615c1676f8552 to your computer and use it in GitHub Desktop.
Save vmleon/cebf3304be6d5685caa615c1676f8552 to your computer and use it in GitHub Desktop.
Oracle Spatial Example: Warehouses and Branches, big query
SELECT
BRANCH_NAME,
ROUND(SDO_NN_DISTANCE(1), 2) DISTANCE_KM
FROM
BRANCHES B,
WAREHOUSES W
WHERE W.WAREHOUSE_NAME = 'Odessa Warehouse'
AND SDO_NN(B.GEOMETRY, W.GEOMETRY, 'sdo_num_res=5 unit=km', 1) = 'TRUE'
ORDER BY DISTANCE_KM;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment