I would like to select all values for an attribute using select layer by attribute to use in model builder and hopefully save the expression for automation purposes.

If I have an attribute named COUNTY how do I select all values for this attribute?

The end goal is to automate specific layer creation; while avoiding make feature layer and using the field info dialog box.

Select layer by attribute(would always be all values in an attribute) Make Feature Layer from selected attributes Apply symbol Output database

enter image description here

I would like to use a SQL expression to select all rows in the county field.

*Edit This is a work around to avoid having an array of check boxes in the field info from the make feature layer function.

So I would like to select all values in the COUNTY field and make a feature layer from county. So my end attribute table would appear like:

enter image description here


Based on the discussion in the comments, what was actually being asked for was an easier way to select just one column to be retained in the output feature layer. The Make Feature Layer tool can do this via the 'Field Info' parameter, which presents you with a list of checkboxes (all checked by default) representing all of the fields which will be visible in the output layer.

Since the OP did not want to have to manually uncheck many checkboxes, I suggested holding Ctrl while clicking on one of the checkboxes, which unchecks or re-checks all of the checkboxes at once.

| improve this answer | |

I'm not sure if I understand your question correctly, but I think what you're asking is you just want a SQL query to use in Select by Attribute GP Tool's expression field; and you want this SQL query to always select all of the records in the table/feature class. If so, why don't you just use a SQL expression along the lines of


That would select all records all the time. Again, I'm not positive if this is what you're asking for, but I think so... and if not, please comment a response and/or edit the question.

| improve this answer | |

From what you have described in comments, and your added screenshots, I think that you want to just pull a single field through from your original feature class (with many fields) to make a new feature class with just that one field.

There is a technique described in Re-ordering fields permanently using ArcGIS Make Query Table tool? that I believe will meet your described requirements. In your case you will just pull the one field through (which is not what you might normally think of as re-ordering) but the technique should do that just as easily as the permanent re-ordering of fields that it was developed for.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.