Public Cursor Query (boolean distinct, string table, string[] columns, string selection, string[] Selectionargs, String gr Oupby, string having, string-by-clause, string limit)
The various parameters are as follows (you can specify NULL if one of the parameters is not set):
Distinct:distinct true if you want each row to be unique, false otherwise.
Table: List name. Corresponds to the part of the SELECT statement following the FROM keyword. If you are a multi-table union query, you can separate the two table names with a comma.
Columns: The name of the column to query. Corresponds to the part of the SELECT statement after the SELECT keyword.
Selection: The query condition clause, which is equivalent to the part of the SELECT statement following the WHERE keyword, allows the use of placeholders in conditional clauses? ”
Selectionargs: Corresponds to the value of the placeholder in the selection statement, the position of the value in the array must match the position of the placeholder in the statement, or there will be an exception.
GroupBy: Equivalent to the part of the SELECT statement after the GROUPBY keyword
Having: equivalent to the part of the SELECT statement after the HAVING keyword
By: Equivalent to the part of the SELECT statement after the keyword
Limit: Specifies the offset and number of records fetched, which is equivalent to the portion of the SELECT statement after the Limit keyword
Android (Java) Learning Note 141:sqlitedatabase parameter analysis of Query method