0
回答
SQLite該如何才可將總和的數值顯示出來
利用AWS快速构建适用于生产的无服务器应用程序,免费试用12个月>>>   
helper = new DataBaseManager(QueryActivity.this,DatabaseInfo.DATABASENAME,null,DatabaseInfo.VERSION);
db = helper.getReadableDatabase();
cursor = db.query(DatabaseInfo.TABLENAME, new String[]{"_id","paydate","item1","paymoney" }, null,null,null,null,"_id");
boolean result = cursor.moveToFirst();   
if(result)
  {
    allData  = new ArrayList<Map<String,String>>();
    while(result)
  {
    Map<String,String> record = new HashMap<String,String>();
   record.put("_id",cursor.getString(cursor.getColumnIndex("_id")));
    record.put("paydate",cursor.getString(cursor.getColumnIndex("paydate")));
    record.put("item1",cursor.getString(cursor.getColumnIndex("item1")));
    record.put("paymoney",cursor.getString(cursor.getColumnIndex("paymoney")));
    allData.add(record);
    result = cursor.moveToNext();
  }
 
    db.close();
  }else
  {  
  return;

  }

想請教各位前輩,小弟不知道該如何做才可以將"paymoney"這個欄位總和的值 經查詢 show出來

請賜教  感謝><

举报
Makoto
发帖于3年前 0回/48阅
顶部