Select to view content in your preferred language

Select by attribute query to select the maximum value entry

2845
4
11-20-2014 03:02 PM
HemantAngarkar2
Frequent Contributor

Hi,

 

I am trying to select by attribute query in a file geodatabase,

 

[Address_ID] In (SELECT [Address_ID] FROM [Sunset_and_Goldengate_Monday_II] GROUP BY [Address_ID] HAVING Count(*)>1 )

 

It is not working, whereas it works in Personal geodatabase. I want o select features which has maximum values in let's say b field. And I have Address_ID field which has duplicate entries like this;

Address_IDB
A1
A2
A3
B1
B2

So I want to select A which has 3 (Maximum) as a value in B field, also b which has 2 (maximum) as a value.

 

Any help is appreciated.

0 Kudos
4 Replies
DarrenWiens2
MVP Honored Contributor

A quick search yielded this Knowledge Base Article (Select minimum and maximum values in the Select By Attributes dialog box) explaining that this cannot be done in File GDBs and these solutions, which are probably more complicated than you want to see, on GIS StackExchange.

0 Kudos
HemantAngarkar2
Frequent Contributor

Thanks Darren, I am on 10.2.1 where these queries don't work. It works in 9.3.1. GIS Stackexchange were not working on select by attribute. Thanks for the help.

0 Kudos
XanderBakker
Esri Esteemed Contributor

The field names are between square brackets as with a file geodatabase you don't use brackets nor quotes around the field names. 

0 Kudos
HemantAngarkar2
Frequent Contributor

I tried without brackets and without quotes, still nothing. thanks for the reply!!

0 Kudos