CompoundStatement

Represents a compound SELECT statement in SQL, allowing the combination of results from multiple SELECT statements using operators like UNION, UNION ALL, EXCEPT, and INTERSECT.

This interface provides a fluent API to build complex queries by chaining these compound operators. Each method takes a lambda that returns a SelectStatement to be combined with the preceding one.

Inheritors

Functions

Link copied to clipboard
abstract fun <S : KQLiteTable> except(select: () -> SelectStatement<S>): SelectStatement<S>

Appends an EXCEPT operator to the current query, returning rows from the first SELECT statement that are not present in the result set of the second SELECT statement.

Link copied to clipboard
abstract fun <S : KQLiteTable> intersect(select: () -> SelectStatement<S>): SelectStatement<S>

Appends an INTERSECT operator to the current query, returning only the rows that are present in the result sets of both SELECT statements.

Link copied to clipboard
abstract fun <S : KQLiteTable> union(select: () -> SelectStatement<S>): SelectStatement<S>

Appends a UNION operator to the current query, combining its result set with another SELECT statement.

Link copied to clipboard
abstract fun <S : KQLiteTable> unionAll(select: () -> SelectStatement<S>): SelectStatement<S>

Appends a UNION ALL operator to the current query, combining its result set with another SELECT statement.