Sunday, 20 January 2019

Selecting max value from group using ArcGIS definition query?


In ArcGIS 10 I am trying to do a Definition Query that will select the records that are the max values from a specific group.


Here is what I have tried in the Query Builder but I am getting an "the SQL statement is invalid." error.


"TL" IN (SELECT max( "TL" ) FROM "Instrument_Locations2_20120227" GROUP BY "Site_ID" )


enter image description here




Answer



This was solved by keeping data in personal geodatabase and modifying the statement to: [TL] <> 0 AND [TL] IN (SELECT MAX( [TL] ) FROM wstest GROUP BY [Site_ID] )


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...