gpt4 book ai didi

java - 在 SQLite 中检索 TimeInMillis

转载 作者:行者123 更新时间:2023-12-02 12:16:33 26 4
gpt4 key购买 nike

数据库助手

 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));

最佳答案

假设today是变量,COL_5datetimez

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());
}
}

关于java - 在 SQLite 中检索 TimeInMillis,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46129606/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com