Search code examples
restarcgisarcgis-server

Writing Nested WHERE clause in ArcGIS Rest API Feature Service


I'm attempting to query a feature service using a nested WHERE clause. I'm trying to return the record with the highest OBJECTID count, but I'm not sure how to really adapt this to the REST query. On a feature class i would expect the WHERE clause to look something like;

SELECT MAX("OBJECTID") FROM (feature class name)

How would one go about adapting this expression to the REST query form for the WHERE clause? Thanks.


Solution

  • You can set the output statistics value to return this (leave the where clause blank).

    [{"statisticType":"max","onStatisticField":"OBJECTID", "outStatisticFieldName":"maxobjectid"}]