Select Statement
Represents a builder for a SQL SELECT statement.
This interface provides methods to construct a SELECT query by chaining clauses like WHERE, JOIN, GROUP BY, ORDER BY, HAVING, and LIMIT.
An instance of this interface is typically obtained by calling the select() extension function on a KQLiteTable object. The query is executed by calling the execute method at the end of the chain, which returns a KQLiteCursor to iterate over the results.
It also inherits from JoinStatement to support JOIN operations and CompoundStatement to support UNION, INTERSECT, and EXCEPT.
Example
val cursor = Employees
.select(Employees.id, Employees.firstName)
.innerJoin(Departments)
.on(Employees.departmentId, Departments.id)
.where { Employees.age GT 30 }
.orderBy(Employees.lastName, Sort.ASC)
.limit(10)
.execute()Author
MOHAMMAD AZIM ANSARI
Type Parameters
The type of the primary KQLiteTable the query is being performed on.
See also
Functions
Creates an alias for a subquery (a SELECT statement) using SQL AS.
Adds a CROSS JOIN clause to the SELECT statement
Same as calling execute(null). Uses last opened connection.
Executes the constructed SELECT query and returns the result set.
Same as calling groupBy(column, null)
Adds a GROUP BY clause to the SELECT statement.
Adds an INNER JOIN clause to the SELECT statement.
Adds a JOIN clause to the SELECT statement.
Adds a LEFT JOIN clause to the SELECT statement.
Same as calling orderBy(column, null)
Adds an ORDER BY clause to the SELECT statement to sort the result set.
Adds an ORDER BY clause to the SELECT statement to sort the result set by one or more columns, each with its own specific sorting order.