sqlite 查询数量

    public Integer getUnreadTaskCount() {

        Cursor c = db.rawQuery("select count(id) from patrol_task " +
                "where cur_uid = ? " +
                "and unread = 1 " , new String[]{"" + User.myUid});
        c.moveToFirst();
        int count = c.getInt(0);
        c.close();
        return count;
    }

 

你可能感兴趣的:(数据库)