ArcGIS REST API allows to perform statistical functions on the Map service layers.
http://resources.arcgis.com/en/help/rest/apiref/index.html?featureserver.htmlLayer resource contains supportsStatistics that indicates if the layer supports statistical functions in query operations and supportsAdvancedQueries to indicate if the layer supports orderBy in a query operation.Awfully this functionality is limited to layers whose source is Geodatabase. I would like query layers to get this functionality as well. Query layers have huge advantage, when server side joins, computed colums are required.