Friday, 3 August 2007

Example statement 03

Select all the counties within a certain area:

select sum (mdsys.sdo_geom.sdo_area (c1.geom,

(SELECT diminfo

FROM sdo_geom_metadata

WHERE table_name = 'COUNTIES'

AND column_name = 'GEOM'))) area

from counties c1,

counties c2

where c2.state = 'New Jersey'

and c2.county = 'Passaic'

and mdsys.sdo_relate (c1.geom, c2.geom, 'mask=TOUCH querytype=JOIN') = 'TRUE';


No comments: