Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

get sum sqlite android

 Cursor cursor = db.rawQuery("SELECT SUM(" + DbHelper.CART_TOTAL + ") as Total FROM " + DbHelper.CART_TABLE, null);

 if (cur.moveToFirst()) {

 int total = cursor.getInt(cursor.getColumnIndex("Total"));// get final total
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sum #sqlite #android
ADD COMMENT
Topic
Name
1+9 =