在互联网得到了很多人的帮助,很多解决问题的方法都能百度到。如何查询 AB之间的数据(A,BY该是个数值),我却一直没有找到。至少我没有百度到。不过通过我自己的摸索还是搞出来了。希望能给其他人一些帮助。关键代码:

 

 public Cursor select_day_between(int A,int B) {
  SQLiteDatabase db = this.getReadableDatabase();
  Cursor cursor = db.query("day", null, "c_date BETWEEN ? AND ?",new String[] { Integer.toString(A),Integer.toString(B) }, null, null, null);
  return cursor;
 }

关于SQLite的文章也推荐一下。

http://www.blogjava.net/myqiao/archive/2011/07/13/354298.html

另外我还想知道在android下的sqlite如何求和。不要告示我用for,或 while自己做累加

Logo

汇聚全球AI编程工具,助力开发者即刻编程。

更多推荐