数据库助手
public Cursor getAllData() {
SQLiteDatabase db = this.getWritableDatabase();
Cursor res = db.rawQuery( "SELECT * FROM " + TABLE_NAME, null);
return res;
}
我想要的是db.rawQuery("select * From "+TABLE_NAME,null WHERE COLUMN datetimez(today));
答案 0 :(得分:1)
假设today
是变量而COL_5
是datetimez
。
Cursor cursor = db.rawQuery("select * from " + TABLE_NAME + " where " + COL_5+ "='" + today + "'" , null);
if (cursor.moveToFirst())
{
do {
// your code like get columns
}
while (cursor.moveToNext());
}
}