SQLiteDatabase.query

1 篇文章 / 0 new
author
SQLiteDatabase.query

public Cursor query (boolean distinct, String table, String[] columns, String selection, String[] selectionArgs, String groupBy, String having, String orderBy, String limit)

public Cursor query (String table, String[] columns, String selection, String[] selectionArgs, String groupBy, String having, String orderBy, String limit)

public Cursor query (String table, String[] columns, String selection, String[] selectionArgs, String groupBy, String having, String orderBy)

 

Query the given URL, returning a <a href="../../../../reference/android/database/Cursor.html">Cursor</a> over the result set.

Parameters
distincttrue 則使用 DISTINCT 條件傳回資料
tabletable name
columns傳入要取回的欄位名稱陣列,若傳入null時則傳回所有欄位資料
selectionSQL WHERE 敘述據的條件資料. null 則傳回所有資料
selectionArgs若 WHERE 條件敘述內有使用 ? 變數, 則變數資料由此帶入
groupBySQL GROUP BY 條件設定.
havingSQL HAVING 條件設定
orderBySQL ORDER BY 條件設定.
limit限定傳回筆數, null 則不限定
Returns
  • A <a href="../../../../reference/android/database/Cursor.html">Cursor</a> object, which is positioned before the first entry. Note that <a href="../../../../reference/android/database/Cursor.html">Cursor</a>s are not synchronized, see the documentation for more details.

 

Free Web Hosting