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

SELECT s.* 
FROM StackDetection s JOIN fgetNearbyObjEq(221.30, 1.5, 30) n
ON s.objID = n.objID
ORDER BY s.objid, stackDetectid