我使用类似于以下代码的代码在两个日期之间搜索数据库:
cursor.query(select column from Table where columnDate between '2018-09-20' and '2018-09-23');
但是现在我想使用查询projection
,selection
和selcetionArgs
。
如何更新代码?
答案 0 :(得分:1)
您可以使用此:
cursor.query("Table" ,
new String[]{"column"},
"columnDate BETWEEN ? AND ?",
new String[]{"2018-09-20","2018-09-23"},
null/*Group by if you need*/,
null/*having if you need*/,
null/*order by if you need*/);