SQLite查询记录总数

时间:2015-11-17 18:19:34   收藏:0   阅读:745
public int getCount() {
  SQLiteDatabase db = dbOpenHelper.getReadableDatabase();
  Cursor cursor = db.rawQuery("select count(id) from table",null);
  cursor.moveToFirst();
  Long count = cursor.getInt(0);
  cursor.close();
  return count;
 }

 

原文:http://www.cnblogs.com/chenlong-50954265/p/4972215.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!