Table of Contents
SQLiteDatabase.query() の引数を忘れがちなのでメモ
第1引数:テーブル名 (String table = “TEST_TABLE”)
第2引数:取得する列名(カラム名、フィールド名)の配列を指定 ( String[] columns = new String[]{“_id”, “column”})
第3引数:取得するレコードの条件を指定 (String where = “column = ?”)
第4引数:第3条件で指定した条件にバインドする値 (String[] param = new String[]{“hoge”})
第5引数:group by句を指定
第6引数:Having句を指定
第7引数:order by句を指定 (String orderby = ”_id desc”)
第8引数:limit句(取得するレコードの上限数)を指定 (String limit = “100”)
//クエリーを投げて、検索して取得結果のカーソルを取得 cursor = database.query(table, columns, where, param, null, null,orderby, limit);