How do I return a sum of data entries from my database?

I have a column full of doubles (hundreds of them). I need to know the total value of all those doubles added together. How can I get this value and how/where do I need to execute the code for this function?

Until now I’ve just been using PHP/rest to return individual values, but I’ve noticed that I can only return something like 100(?) entries at a time (pretty useless for a database I think) which leaves me with huge limitations. My database will eventually have thousands of entries and I want to get the accumulative value (or all those values) in a single step.

Can anyone guide me or is this just not going to be possible with Backendless?

Many thanks.

For example, I cant seem to do a simple SQL query such as :

SUM (myColumn)

Surely there is something like this I can do easily? No?

Hi Simon,

We have not made a public announcement for that functionality, but since you asked, take a look here:


Works perfectly. Many thanks!

By the way, is it also possible to somehow return the top ten values easily…or the bottom ten. It would save me getting ALL the data and sorting through it with my own code.

You can sort by specific field and return ‘pageSize’ number of values.

Yeah, this still confuses me. What if I have 100,000+ entries? Or in my case the number is undetermined. It could be from 0 to hundreds of thousands. How do I go about paging through that and getting the top ten?

You can sort either in ascending or descending order, this is mentioned in the doc I linked above, have you seen it?