HI, I am working with a feature class stored in a File Geodatabase In ArcGIS 10, . I want select the maximum value by ID like the example below:
I tried the following sql query but without result : VALUE in (SELECT max(VALUE) FROM featureClass GROUP BY ID)
How can I solve?
ID | VALUE |
1 | 5 |
1 | 2 |
1 | 10 |
2 | 3 |
2 | 4 |
2 | 6 |
3 | 16 |
3 | 20 |
3 | 4 |
Hello,
Just to confirm, your values in the above table are left-indented, suggesting text. Are your values text or numeric values. Numeric values usually displayed w/ right-indent.
Regarding your sql, maybe change your sql from:
VALUE in (SELECT max(VALUE) FROM featureClass GROUP BY ID)
To
[Value] IN (SELECT MAX( [Value] ) FROM featureClass GROUP BY [ID] ).
-Jeff
Thank you for your feedback, the values are all numeric, I tried your solution, but it didn't work.
I don't believe File GeoDatabases support GROUP BY when selecting rows in a table? A quick search of this forum and GIS SE and you see many threads about the issue.
If you want to create a table of just that data (which is different to selecting rows) then you can use the summary statistics tool as shown below:
Thank you DuncanHornby, you are right, GROUP BY is not supported in geodatabases file and shape files, I think I will try to do it on personal geodatabase with ACCESS.