[GIS] How to filter unique values using a definition query on a File Geodatabase

arcmapdatadefinition-query

Is there a way to filter unique values only from a column in ArcMap using definition query? i.e to use a Definition Query to filter out just those values which occur only once.

In a Personal Geodatabase I can use "DISTINCT", what about File Geodatabase format?

Thanks for your help.

Best Answer

I'm not sure your end goal. Definition Query is there to remove items from the layer - NOT to group items within a layer. You will want to use symbology to group items in a layer. However, here is a sample definition query that will select out of your layer ONLY the records with the first instance of each value: (replace items in brackets with your own field and layer names).

[primarykey] in (
    select min([primarykey]) from [Your layer name] group by [value]
)