Adding a table to the SQL statement

The standard ArcMap Query Builder allows you to construct a WHERE clause to filter or select the rows of a feature class or table based on attributes contained within it. With the Visual Specifications Tool's Query Builder, you can construct full SQL SELECT statements, including inner joins of multiple tables and feature classes. If needed, you can fully specify all the clauses (SELECT, FROM, WHERE, GROUP BY, and ORDER BY) that a SQL query supports.

Étapes :
  1. Right-click the layer for which you want to define a calculated specification rule and click Properties.

    The Layer Properties dialog box appears.

  2. Click the Calculated Representations or Calculated Fields tab.
  3. If necessary, create a new representation and rule.
  4. Click the SQL Statement drop-down arrow and click Edit SQL statement.

    The Query Builder dialog box appears.

    Query Builder dialog box
  5. Click Add Table.

    The Add Table dialog box appears.

  6. Navigate to the feature class, relationship class, or table you want to add to the statement.
  7. Click Add.

    The Query Builder dialog box appears.

  8. Choose the field from the added table you want to use in the selection.
  9. Click Add to SELECT if you want to be able to use the field value to later define a VBScript.
  10. Click Add to WHERE to use the field to determine your selection set.
  11. Click All Values.

    All the unique values for the field appear in the Values list.

  12. Choose one of the values in the Values list.
  13. Click Add to WHERE.
  14. Click one of the operator buttons.
  15. Repeat steps 5–11 until your statement is complete.
  16. Click Verify to validate the SQL statement.
  17. Click OK.
    ConseilConseil :

    You can clear the contents of the SELECT OBJECTID and WHERE areas by clicking Clear.


10/2/2010