我申请了select MAX(index_no) from Checkin_master
。
我在游标中获取了int值。但我不知道将该值存储在integer.my代码中的方法如下。
Cursor c=db.rawQuery("select MAX(index_no) from CheckIN_master",null);
if(c!=null){
while(c.moveToNext())
{
in_no=c.
}
}
请帮帮我。
答案 0 :(得分:0)
试试这个
Cursor c=db.rawQuery("select MAX(index_no) as MAX_NO from CheckIN_master",null);
if(c!=null){
while(c.moveToNext())
{
in_no=c.getInt(c.getColumnIndex("MAX_NO"));
}
}