I am querying a feature class that has thousands of objects using Select Layer by Attribute. I need to include almost 400 attributes, is there an easier way to write this besides selecting/typing out the name of each attribute?? For example: There are thousands of objects in a feature class each associated with one of hundreds of projects (already identified) and I need to select the objects only associated with a subgroup of 400 of those projects. Select Object where the Project_Name is equal to project A or Project b...x400. The selected subgroup will then be exported into a new feature class specifically for that group of projects. What is the easiest way to do this?
Solved! Go to Solution.
You could also create a table that has those hundreds of values that you want to select on, then join this new table to the original table using the field of interest. Then you can do a pretty simple Select by Attributes to get anything that doesn't have NULL in the joined table.
If the identifying attribute is in a field... then
Split By Attributes (Analysis)—ArcGIS Pro | Documentation
See SQL reference for query expressions used in ArcGIS—ArcGIS Pro | Documentation , you will want to use SQL IN operator:
Comparison operators
You use comparison operators to compare one expression to another.
Operator Description [NOT] IN
Selects a record if it has one of several strings or values in a field. When preceded by NOT, it selects a record if it doesn't have one of several strings or values in a field. For example, this expression searches for four different state names:
STATE_NAME IN ('Alabama', 'Alaska', 'California', 'Florida')
What would be the easiest way to list the 400 values that the Project_Name could be IN?
You could also create a table that has those hundreds of values that you want to select on, then join this new table to the original table using the field of interest. Then you can do a pretty simple Select by Attributes to get anything that doesn't have NULL in the joined table.
400 attributes? To quote the late, great Walter Becker of Steely Dan: 'All I can say is ouch'