AnsweredAssumed Answered

Is it possible to do a feature Query from javascript client to obtain the MAX value for attribute/column

Question asked by dannyvenier on Jun 22, 2017
Latest reply on Jun 22, 2017 by dannyvenier

I'm familiar with the QueryTask and Query where I can specify a WHERE clause where the layer URL is baked into the QueryTask and thus points to the table backing the layer map service.  In that case, I'm limited to specifying only the WHERE clause of a traditional SQL query.

In this case I want to get a maximum from a column so I would need to specify a full SQL query (or a subquery to the WHERE clause) to contain SELECT MAX("date_time").  I see with ArcMap, there is a full SQL API to query but nothing equivalent for a javascript client using the SDK (3.2)?

 

Is it possible to specify something like myQuery.where = "EXISTS (SELECT MAX(date_time))" , then execute the query within the QueryTask pointing to the layer Url ?

 

If this is not possible, is there any other way to do this, perhaps using statistics?

Outcomes