I need some help with the SUM feature in android app. I have a table that looks something like the following :
I have need to SUM
Quantities between last two records Notes and last one record with Note. I need to sum Quantity of rows 31,32 and 33. It would return 90. I've tried
SELECT Sum(QUANTITY) FROM fuel_table WHERE NOTE!='' ORDER BY ID DESC
but it returns SUM of all quantities with note.
Aucun commentaire:
Enregistrer un commentaire