📅  最后修改于: 2022-03-11 15:05:08.294000             🧑  作者: Mango
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