Use many-to-many joins via a query layer
【相关信息】
Article ID: 46189
Software:
ArcGIS for Desktop Basic 10.4, 10.3.1
ArcGIS for Desktop Standard 10.4, 10.3.1
ArcGIS for Server 10.3.1
Platforms:
Windows Windows 8, Server 2012, Windows 7, Server 2008 R2, Windows 8.1, Server 2012 R2, Windows 10
【问题描述】
Many-to-many joins are difficult to handle with ArcGIS. The table grid in ArcMap requires a unique identifier for each row in a table and this condition is violated by joins of this type. Currently the table grid displays one of the matching rows. The matching row selected for display is effectively random.
Through the use of a query layer, many-to-many joins can be more effectively handled. The table grid behaves similarly to the RDBMS and queries against the data are more consistent with the expected behavior.
Article ID: 46189
Software:
ArcGIS for Desktop Basic 10.4, 10.3.1
ArcGIS for Desktop Standard 10.4, 10.3.1
ArcGIS for Server 10.3.1
Platforms:
Windows Windows 8, Server 2012, Windows 7, Server 2008 R2, Windows 8.1, Server 2012 R2, Windows 10
【问题描述】
Many-to-many joins are difficult to handle with ArcGIS. The table grid in ArcMap requires a unique identifier for each row in a table and this condition is violated by joins of this type. Currently the table grid displays one of the matching rows. The matching row selected for display is effectively random.
Through the use of a query layer, many-to-many joins can be more effectively handled. The table grid behaves similarly to the RDBMS and queries against the data are more consistent with the expected behavior.
1 个回复
易智瑞技术支持
赞同来自:
Any variation of the Add Query Layer tool can be used to create the layer.
File > Add Data > Add Query Layer
Make Query Layer in the Data Management > Layers and Table Views toolbox
The results are the same whatever tool is used.
1. In ArcMap bring up the New Query Layer tool: File > Add Data > Add Query Layer.
2. Under Connections, connect to the data source.
3. Enter a query establishing a left outer join between the tables. Do not use asterisks (*) in the SELECT list.
Provide a qualified list of all of the fields to be returned. Field names cannot be duplicates and must be aliased.
Table1: streets
Table2: busroutes
Join Field: street_id
4. Use the ObjectID from each table as unique identifier fields.
5. Click Finish.
The query layer is added to the Table of Contents. All matching rows display in the table grid. Duplicate geometries display when there are multiple matches.
This works for ArcMap and ArcGIS Pro. It is persisted by saving the map document or project. If published to a map service, the query layer can be queried and displayed.
【创建及修改时间】
Created: 1/22/2016 Last Modified: 2/23/2016
【原文链接】
http://support.esri.com/en/kno ... 46189
要回复问题请先登录或注册