4

I have a vector file with field of type LONG. Some values of this field are duplicates.

Is it possible to make such SQL definition query in ArcGIS 10.3 to show only unique values without duplicates?

Example data: 1, 2, 3, 3, 3, 4, 5, 1, 6

What I want: 1, 2, 3, 4, 5, 6

Picture examples:

1) Before definition query:

Before definition query

2) After definition query:

After definition query

  • 2
    Please edit this question to specify the RDBMS in use, clarify whether an enterprise geodatabase is present, and provide a complete definition of the table involved (including multiple rows of data). It's not likely that a definition query could solve this data modelling problem, but a different solution is likely possible once you've clearly defined the problem. – Vince Jul 8 '15 at 10:53
  • Can you explain more about what you're trying to do? A definition query like this doesn't make sense. If you have multiple polygons with the same value, how would you pick which of them should be selected/displayed? Are you simply wanting a list of unique values for that field? Are you trying to eliminate duplicate shapes, and if so are they actually identical duplicates? – Chris W Jul 8 '15 at 19:46
  • @Chris W I really don't care which of duplicate polygons will be removed from selection - doesn't matter first, last or "middle" polygon will remain. I dont need simple list of fields unique values. The shapes are not duplicated - only the fields values are the same. – Mr. Che Jul 9 '15 at 5:21
  • I'm still not understanding then. If you don't have duplicate shapes, you have a bunch of polygons in different places that might have the same value. If it doesn't matter which shape you get, then you don't care about the shapes or locations at all, just the unique values. But you say you need more than just a list of the unique values. Are you just trying to get a random example shape for each unique value? Can you provide a screenshot example/marked up graphic of what you're trying to accomplish with the definition query? – Chris W Jul 9 '15 at 19:26
  • 4
    That helps. I think what you actually want to do is Dissolve your layer on that field. You can allow multiparts or not, which will determine if you get separate rows or not if any of the polys with the same value have disconnected geometries. If you don't want to dissolve first, then basically you just want to select one random/first returned polygon for each unique value, and I don't believe you can do that with a def query. As @Vince mentions you could probably do it with a View if using a RDBMS. – Chris W Jul 10 '15 at 19:47
1

As commented by @Vince:

It is certainly possible, once the problem is better defined, to fashion a solution using SQL (leveraging a view), and Python would not be necessary

What seems to be missing from your question to attract a potential answerer is a response to @Vince's earlier comment:

Please edit this question to specify the RDBMS in use, clarify whether an enterprise geodatabase is present, and provide a complete definition of the table involved (including multiple rows of data). It's not likely that a definition query could solve this data modelling problem, but a different solution is likely possible once you've clearly defined the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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