public Double getCostt(String a) {
openDatabase();
Double price = null;
Cursor cursor0=myDataBase.rawQuery("Select*FROM fillup_record WHERE Vehicle_Name='"+a+"'", null); //getting all values where vehicle name wi
在我的databasehelper类中,并为我的活动返回一个double值?提前感谢
cursor0.moveToFirst();
while (!cursor0.isAfterLast())
{Cursor cursor = myDataBase.rawQuery("SELECT sum(Total_Cost) FROM fillup_record GROUP BY Vehicle_Name", null);
price = Double.parseDouble(cursor.getString(3));
cursor0.moveToNext();
}
cursor0.close();
myDataBase.close();
return price;
}
}