App Engine's datastore does not allow for subqueries -- you will either have to structure your data model to return the results in a single query or issue multiple queries and resolve them using your own logic. Obviously, the former is preferred.
Also, keep in mind that aggregate functions aren't supported by App Engine's datastore. The best way to handle aggregate functions is computing values at write time -- i.e. for average, you can store the total count and total salary in separate entities and update them when new employees are added. Then when the average is requested, just fetch these two entities and return the result. This approach does require that you know in advance which aggregate data you'll need. - Jason On Tue, Sep 22, 2009 at 10:17 PM, rams <[email protected]> wrote: > > hi i need help to solve the query as stated below > > SELECT FROM Employee WHERE salary > > (SELECT avg(salary) FROM Employee e WHERE e.lastName == > this.lastName) > > is there any possibility to implement this query in java app engine > and jdo. > > > please help me in this issue; > > > thanks. > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~----------~----~----~----~------~----~------~--~---
