6. Select by Attributes¶
Goal: Filter features with SQL — the most-used analysis action in ArcGIS Pro.
Where to find it¶
| Method | How |
|---|---|
| Map ribbon → Select by Attributes | Most common |
| Right-click layer → Selection → Select by Attributes | Same |
| Geoprocessing tool: Select Layer By Attribute | For models / scripts |
The query builder¶
You can build queries two ways:
1. Click-to-build¶
- Pick a field
- Pick an operator (=, <>, >, IN, LIKE, IS NULL)
- Pick / type a value
ArcGIS Pro builds the SQL behind the scenes.
2. SQL mode¶
Toggle SQL at the bottom of the dialog and type directly:
→ Full SQL reference: SQL for GIS.
Common patterns¶
-- Single condition
COUNTY = 'Fulton'
-- Multiple AND
STATE_NAME = 'GA' AND POPULATION > 50000
-- OR
STATE_NAME = 'GA' OR STATE_NAME = 'FL'
-- IN (cleaner than OR)
STATE_NAME IN ('GA', 'FL', 'SC')
-- Pattern match
NAME LIKE 'A%' -- starts with A
NAME LIKE '%ville' -- ends with ville
-- Range
POP BETWEEN 10000 AND 50000
-- Null check
NOTES IS NULL
NOTES IS NOT NULL
-- Negation
NOT (LANDUSE IN ('Industrial','Commercial'))
Selection methods¶
The dialog has a Selection method dropdown:
| Method | Effect |
|---|---|
| New selection | Replaces current selection |
| Add to current selection | Union |
| Remove from current selection | Subtract |
| Select subset of current selection | Intersect with previous |
| Switch the current selection | Invert — select everything not selected |
| Clear the current selection | Deselect all |
Use these to build complex filters in steps.
Selection vs Definition Query¶
| Selection | Definition Query |
|---|---|
| Highlights matching features | Hides non-matching features |
| Other features still visible & part of analysis | Other features are gone from this layer |
| Fast | Always-on filter |
| Use to highlight | Use to focus |
Set a Definition Query: Layer Properties → Definition Query tab → New.
Tips¶
Check selection count
Bottom-right of the map shows "X of N selected". After every query, glance at it. If you expected 50 and got 5, your query is wrong.
Save a query
Click ⚙ in the Select by Attributes dialog → Save. Reuse later. Helpful for recurring reports.
Quoting
- Strings:
'Atlanta'(single quotes) - Field names with spaces:
"Median Income"(double quotes) - Don't mix the two
Practice¶
Layered selections
- Counties layer.
- Select all counties:
STATE_NAME = 'Georgia'. - Add to selection:
STATE_NAME = 'Florida'. - Subset selection:
POPULATION > 100000. - Right-click the layer → Selection → Convert Selection To Layer. You now have a permanent layer of just those features.
→ Next: Select by Location.