i am very new to the appengine.
anybody help me In finding the maximum salary from the employee table
in appengine datastore.
here shall we have any max() function available like in oracle to find
max salaried employee.
Thanks and regards.
In a word, no. You need to store the maximum salary in the datastore,
and every time time a salary changes check to see if it exceeds the
maximum, and update it if so.
Perhaps you can order by salary property descending, and just get the
first one, for getting max value.
max_salaried_employee = Employee.all().order("-salary").get()
max_salary = max_salaried_employee.salary
hope this helps
--
Takashi Matsuo
Kay's daddy
> --
> You received this message because you are subscribed to the Google Groups "Google App Engine" group.
> To post to this group, send email to google-a...@googlegroups.com.
> To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
>
>
Use a global variable to store max(salary)
On Mar 15, 10:12 am, Takashi Matsuo <matsuo.taka...@gmail.com> wrote:
> Hi,
>
> Perhaps you can order by salary property descending, and just get the
> first one, for getting max value.
>
> max_salaried_employee = Employee.all().order("-salary").get()
> max_salary = max_salaried_employee.salary
>
> hope this helps
>
> --
> Takashi Matsuo
> Kay's daddy
>
-Ulrich
Even if there are zillions of salaries and they are constantly
changing, it's still unlikely that max(salary) is going to change
often enough for this to be a problem.
Jeff