-- Cone search on P2 detections
-- Give me all the P2 Detections for objects within
-- a cone search.

SELECT s.* 
FROM P2Detection s JOIN fgetNearbyObjEq(221.30, 1.5, 10) n
ON s.objID = n.objID
ORDER BY s.objid, detectID