ArcGIS Desktop

  • Documentation
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Spatial SQL queries on tables with an ST_Geometry column

  • Queries on an ST_Geometry column using a spatial index

You can execute SQL queries on tables that contain ST_Geometry columns to return information about the table itself, to spatially compare the features in one table with features in another table, or to generate new geometry from input tables.

Queries on an ST_Geometry column using a spatial index

The following table contains example spatial queries using a spatial index for geodatabases that use the ST_Geometry type.

DB2

db2 => SELECT sa.name "Sensitive Areas", hs.name "Hazardous Sites" 

FROM sensitive_areas sa, hazardous_sites hs 

WHERE db2gse.st_overlaps (sa.zone, db2gse.st_buffer (hs.location,.01)) = 1

Informix

SELECT sa.name sensitive_area, hs.name hazardous_site 

FROM sensitive_areas sa, hazardous_sites hs 

WHERE st_overlaps(sa.zone, st_buffer(hs.location, .01)) = 't';

Oracle

SELECT sa.name "Sensitive Areas", hs.name "Hazardous Sites" 

FROM sensitive_areas sa, hazardous_sites hs 

WHERE sde.st_overlaps (sa.zone, sde.st_buffer(hs.location,.01)) = 1;

PostgreSQL

SELECT sa.name AS sensitive_area, hs.name AS hazardous_sites

FROM sensitive_areas sa, hazardous_sites hs 

WHERE st_overlaps(sa.zone, st_buffer(hs.location,.01) = 't');

SQL spatial query

Related topics

  • ST_Buffer
  • ST_Overlaps

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal