We use Oracle Spatial (registered as SDE).
We would like to perform a spatial query, then determine the extent of all of the points in the resultset then perform another intersecting spatial query with that extent.
Is it possible to obtain the data extent of a Spatial Query Result Set?
After further review I THINK this is the answer:
SELECT SDO_AGGR_CONVEXHULL(SDOAGGRTYPE(geom, 0.5)) coverage
from
(
SELECT geom
from risk.risk_location
where SDO_INSIDE(geom, SDO_GEOMETRY(2003,8307,NULL,
SDO_ELEM_INFO_ARRAY(1,1003,1),SDO_ORDINATE_ARRAY(
-89.228,45.915, -89.079,45.932, -89.091,45.791, -89.173,45.799)))= 'TRUE');