Imagine I have this table:
tagId | amount |
---|---|
1 | 100 |
1 | 150 |
2 | 200 |
2 | 250 |
And i need to sum the amount
by grouping the tagId
.
In SQL we can do this by:
SELECT tagId, SUM(amount) FROM orders GROUP BY tagId;
Query result:
tagId | SUM(amount) |
---|---|
1 | 250 |
2 | 450 |
How can I get such results in ObjectBox ?