Android (Java) Learning Note 141:sqlitedatabase parameter analysis of Query method

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.