I am have a feature class of thousands of cities, however sometimes the cities are not a single polygon and instead have small fragments separate, with their own object ID, but the same name field.
I was trying to label the cities so that it would only pull the largest one (Shape.STArea() is the name for volume in my database) of each city name (NAME is the attribute for city name).
I don't have any formal programing experience, and got as far as creating a query to only label the single largest attribute by doing:
Shape.STArea() =(SELECT MAX( Shape.STArea() ) FROM DBO.CityArea)
However I couldn't figure out how to do this for each "NAME" I was tinkering with loops but I couldn't seem to get anything to work.
Note: none of the cities have the same name other than the fragments, and unfortunately I can't export or change the data, as it is not mine, and I am making layer files for our DPW who all pull from this database.