sqlite with where子句在android中不起作用

时间:2013-03-25 04:46:31

标签: android sqlite where

Log.e("Thinhdt1", qb.buildQuery(new String[] { "sum(money)" }, 
             "category = ?", new String[] {category}, null, null, null, null));

     Cursor mCursor = mDb.query(
         "Exchange",
         new String[] { "sum(money)" },
         "category = ?" , 
         new String[] {category},
         null,
         null,
         null
         );

登录logcat():SELECT sum(money)FROM Exchange WHERE(category =?)

请找错误帮助我。 谢谢。

1 个答案:

答案 0 :(得分:0)

尝试

Cursor mCursor = mDb.query(
     "Exchange",
     new String[] { "sum(money) as sum" },
     "category = ?" , 
     new String[] {category},
     null,
     null,
     null
     );