SQLiteDatabase.Query Method

Definition

Overloads

Query(Boolean, String, String[], String, String[], String, String, String, String, CancellationSignal)

Query the given URL, returning a Cursor over the result set.

Query(Boolean, String, String[], String, String[], String, String, String, String)

Query the given URL, returning a Cursor over the result set.

Query(String, String[], String, String[], String, String, String, String)

Query the given table, returning a Cursor over the result set.

Query(String, String[], String, String[], String, String, String)

Query the given table, returning a Cursor over the result set.

Query(Boolean, String, String[], String, String[], String, String, String, String, CancellationSignal)

Query the given URL, returning a Cursor over the result set.

[Android.Runtime.Register("query", "(ZLjava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Landroid/os/CancellationSignal;)Landroid/database/Cursor;", "GetQuery_ZLjava_lang_String_arrayLjava_lang_String_Ljava_lang_String_arrayLjava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Landroid_os_CancellationSignal_Handler")]
public virtual Android.Database.ICursor? Query (bool distinct, string? table, string[]? columns, string? selection, string[]? selectionArgs, string? groupBy, string? having, string? orderBy, string? limit, Android.OS.CancellationSignal? cancellationSignal);
[<Android.Runtime.Register("query", "(ZLjava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Landroid/os/CancellationSignal;)Landroid/database/Cursor;", "GetQuery_ZLjava_lang_String_arrayLjava_lang_String_Ljava_lang_String_arrayLjava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Landroid_os_CancellationSignal_Handler")>]
abstract member Query : bool * string * string[] * string * string[] * string * string * string * string * Android.OS.CancellationSignal -> Android.Database.ICursor
override this.Query : bool * string * string[] * string * string[] * string * string * string * string * Android.OS.CancellationSignal -> Android.Database.ICursor

Parameters

distinct
Boolean

true if you want each row to be unique, false otherwise.

table
String

The table name to compile the query against.

columns
String[]

A list of which columns to return. Passing null will return all columns, which is discouraged to prevent reading data from storage that isn't going to be used.

selection
String

A filter declaring which rows to return, formatted as an SQL WHERE clause (excluding the WHERE itself). Passing null will return all rows for the given table.

selectionArgs
String[]

You may include ?s in selection, which will be replaced by the values from selectionArgs, in order that they appear in the selection. The values will be bound as Strings.

groupBy
String

A filter declaring how to group rows, formatted as an SQL GROUP BY clause (excluding the GROUP BY itself). Passing null will cause the rows to not be grouped.

having
String

A filter declare which row groups to include in the cursor, if row grouping is being used, formatted as an SQL HAVING clause (excluding the HAVING itself). Passing null will cause all row groups to be included, and is required when row grouping is not being used.

orderBy
String

How to order the rows, formatted as an SQL ORDER BY clause (excluding the ORDER BY itself). Passing null will use the default sort order, which may be unordered.

limit
String

Limits the number of rows returned by the query, formatted as LIMIT clause. Passing null denotes no LIMIT clause.

cancellationSignal
CancellationSignal

A signal to cancel the operation in progress, or null if none. If the operation is canceled, then OperationCanceledException will be thrown when the query is executed.

Returns

A Cursor object, which is positioned before the first entry. Note that Cursors are not synchronized, see the documentation for more details.

Attributes

Remarks

Query the given URL, returning a Cursor over the result set.

Java documentation for android.database.sqlite.SQLiteDatabase.query(boolean, java.lang.String, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String, android.os.CancellationSignal).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

See also

Applies to

Query(Boolean, String, String[], String, String[], String, String, String, String)

Query the given URL, returning a Cursor over the result set.

[Android.Runtime.Register("query", "(ZLjava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;", "GetQuery_ZLjava_lang_String_arrayLjava_lang_String_Ljava_lang_String_arrayLjava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Handler")]
public virtual Android.Database.ICursor? Query (bool distinct, string? table, string[]? columns, string? selection, string[]? selectionArgs, string? groupBy, string? having, string? orderBy, string? limit);
[<Android.Runtime.Register("query", "(ZLjava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;", "GetQuery_ZLjava_lang_String_arrayLjava_lang_String_Ljava_lang_String_arrayLjava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Handler")>]
abstract member Query : bool * string * string[] * string * string[] * string * string * string * string -> Android.Database.ICursor
override this.Query : bool * string * string[] * string * string[] * string * string * string * string -> Android.Database.ICursor

Parameters

distinct
Boolean

true if you want each row to be unique, false otherwise.

table
String

The table name to compile the query against.

columns
String[]

A list of which columns to return. Passing null will return all columns, which is discouraged to prevent reading data from storage that isn't going to be used.

selection
String

A filter declaring which rows to return, formatted as an SQL WHERE clause (excluding the WHERE itself). Passing null will return all rows for the given table.

selectionArgs
String[]

You may include ?s in selection, which will be replaced by the values from selectionArgs, in order that they appear in the selection. The values will be bound as Strings.

groupBy
String

A filter declaring how to group rows, formatted as an SQL GROUP BY clause (excluding the GROUP BY itself). Passing null will cause the rows to not be grouped.

having
String

A filter declare which row groups to include in the cursor, if row grouping is being used, formatted as an SQL HAVING clause (excluding the HAVING itself). Passing null will cause all row groups to be included, and is required when row grouping is not being used.

orderBy
String

How to order the rows, formatted as an SQL ORDER BY clause (excluding the ORDER BY itself). Passing null will use the default sort order, which may be unordered.

limit
String

Limits the number of rows returned by the query, formatted as LIMIT clause. Passing null denotes no LIMIT clause.

Returns

A Cursor object, which is positioned before the first entry. Note that Cursors are not synchronized, see the documentation for more details.

Attributes

Remarks

Query the given URL, returning a Cursor over the result set.

Java documentation for android.database.sqlite.SQLiteDatabase.query(boolean, java.lang.String, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

See also

Applies to

Query(String, String[], String, String[], String, String, String, String)

Query the given table, returning a Cursor over the result set.

[Android.Runtime.Register("query", "(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;", "GetQuery_Ljava_lang_String_arrayLjava_lang_String_Ljava_lang_String_arrayLjava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Handler")]
public virtual Android.Database.ICursor? Query (string? table, string[]? columns, string? selection, string[]? selectionArgs, string? groupBy, string? having, string? orderBy, string? limit);
[<Android.Runtime.Register("query", "(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;", "GetQuery_Ljava_lang_String_arrayLjava_lang_String_Ljava_lang_String_arrayLjava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Handler")>]
abstract member Query : string * string[] * string * string[] * string * string * string * string -> Android.Database.ICursor
override this.Query : string * string[] * string * string[] * string * string * string * string -> Android.Database.ICursor

Parameters

table
String

The table name to compile the query against.

columns
String[]

A list of which columns to return. Passing null will return all columns, which is discouraged to prevent reading data from storage that isn't going to be used.

selection
String

A filter declaring which rows to return, formatted as an SQL WHERE clause (excluding the WHERE itself). Passing null will return all rows for the given table.

selectionArgs
String[]

You may include ?s in selection, which will be replaced by the values from selectionArgs, in order that they appear in the selection. The values will be bound as Strings.

groupBy
String

A filter declaring how to group rows, formatted as an SQL GROUP BY clause (excluding the GROUP BY itself). Passing null will cause the rows to not be grouped.

having
String

A filter declare which row groups to include in the cursor, if row grouping is being used, formatted as an SQL HAVING clause (excluding the HAVING itself). Passing null will cause all row groups to be included, and is required when row grouping is not being used.

orderBy
String

How to order the rows, formatted as an SQL ORDER BY clause (excluding the ORDER BY itself). Passing null will use the default sort order, which may be unordered.

limit
String

Limits the number of rows returned by the query, formatted as LIMIT clause. Passing null denotes no LIMIT clause.

Returns

A Cursor object, which is positioned before the first entry. Note that Cursors are not synchronized, see the documentation for more details.

Attributes

Remarks

Query the given table, returning a Cursor over the result set.

Java documentation for android.database.sqlite.SQLiteDatabase.query(java.lang.String, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

See also

Applies to

Query(String, String[], String, String[], String, String, String)

Query the given table, returning a Cursor over the result set.

[Android.Runtime.Register("query", "(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;", "GetQuery_Ljava_lang_String_arrayLjava_lang_String_Ljava_lang_String_arrayLjava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Handler")]
public virtual Android.Database.ICursor? Query (string? table, string[]? columns, string? selection, string[]? selectionArgs, string? groupBy, string? having, string? orderBy);
[<Android.Runtime.Register("query", "(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;", "GetQuery_Ljava_lang_String_arrayLjava_lang_String_Ljava_lang_String_arrayLjava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Handler")>]
abstract member Query : string * string[] * string * string[] * string * string * string -> Android.Database.ICursor
override this.Query : string * string[] * string * string[] * string * string * string -> Android.Database.ICursor

Parameters

table
String

The table name to compile the query against.

columns
String[]

A list of which columns to return. Passing null will return all columns, which is discouraged to prevent reading data from storage that isn't going to be used.

selection
String

A filter declaring which rows to return, formatted as an SQL WHERE clause (excluding the WHERE itself). Passing null will return all rows for the given table.

selectionArgs
String[]

You may include ?s in selection, which will be replaced by the values from selectionArgs, in order that they appear in the selection. The values will be bound as Strings.

groupBy
String

A filter declaring how to group rows, formatted as an SQL GROUP BY clause (excluding the GROUP BY itself). Passing null will cause the rows to not be grouped.

having
String

A filter declare which row groups to include in the cursor, if row grouping is being used, formatted as an SQL HAVING clause (excluding the HAVING itself). Passing null will cause all row groups to be included, and is required when row grouping is not being used.

orderBy
String

How to order the rows, formatted as an SQL ORDER BY clause (excluding the ORDER BY itself). Passing null will use the default sort order, which may be unordered.

Returns

A Cursor object, which is positioned before the first entry. Note that Cursors are not synchronized, see the documentation for more details.

Attributes

Remarks

Query the given table, returning a Cursor over the result set.

Java documentation for android.database.sqlite.SQLiteDatabase.query(java.lang.String, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

See also

Applies to