In GIS applications, often times the
SELECT * FROM portion of the SQL expression is typically supplied for you, effectively leaving the user to just enter the
Additionally, applications often abstract the SQL language to make it easier for their customers to use & understand (who may not know the ANSI SQL standards), choosing to implement their own implementation of the SQL language for consistency. In some cases, like ArcGIS, the syntax changes based upon the underlying RDBMS.
To query file-based data, including file geodatabases, coverages,
shapefiles, INFO tables, dBASE tables, and CAD and VPF data, you use
the ArcGIS SQL dialect that supports a subset of SQL capabilities. To
query personal geodatabases, you use the Microsoft Access syntax. To
query an ArcSDE geodatabase, you use the SQL syntax of the underlying
DBMS (that is, Oracle, SQL Server, DB2, Informix, or PostgreSQL).
- When querying shapefiles, you enclose fields in double quotes: "AREA"
- When querying a personal geodatabase, you enclose fields in square brackets: [AREA]
- When querying a file geodatabase, you enclose fields in square brackets: "AREA"
- When querying ArcSDE: it depends on the source.
NOTE: SQL operators, reserved words, and functions may also be database dependent when using this methodology for "passing through" the SQL dialect. Querying
DATE fields can be particularly challenging because of formatting expectations.