10.28

查询记录数:

public long getCount()
{
    SQLiteDatabase db = dbOpenHelper.getReadableDatabase();
    Cursor cursor =  db.rawQuery("SELECT COUNT (*) FROM person",null);
    cursor.moveToFirst();
    long result = cursor.getLong(0);
    cursor.close();
    return result;      
}
posted @ 2021-10-28 14:14  平安喜乐v  阅读(16)  评论(0编辑  收藏  举报