Query Layer

Introduced in Esri ArcMap 10, Query layers are map layers whose attribute data is derived from a database based on a query. In ArcMap, users can create new layers or standalone tables that are defined by SQL queries. Any SQL that works in the database works with query layers. User-defined queries are executed on the layer each time the data is used or rendered, which ensures the layer or table data is current. Query layers work in the same way as other ArcMap layers. ArcMap provides a Query Builder user interface that allows a simplified way to query data without knowledge of SQL.

After a query has been created it can be saved as a layer file (.lyr) or used to create a layer package (.lpk) file. This makes it easy to share Query layers with other applications, map documents, and users.

Map documents can be saved and published to ArcGIS Server, making Query layer information available to ArcGIS Server APIs. Query layers can also be created on spatial data in databases that do not contain a geodatabase.

Query layers support the use of spatial joins and relates.