SelectExpression

data class SelectExpression(val columns: List<ColumnDeclaringExpression<*>> = emptyList(), val from: QuerySourceExpression, val where: ScalarExpression<Boolean>? = null, val groupBy: List<ScalarExpression<*>> = emptyList(), val having: ScalarExpression<Boolean>? = null, val isDistinct: Boolean = false, val orderBy: List<OrderByExpression> = emptyList(), val offset: Int? = null, val limit: Int? = null, val tableAlias: String? = null, val extraProperties: Map<String, Any> = emptyMap()) : QueryExpression(source)

Select expression, represents a select statement of SQL.

Constructors

Link copied to clipboard
constructor(columns: List<ColumnDeclaringExpression<*>> = emptyList(), from: QuerySourceExpression, where: ScalarExpression<Boolean>? = null, groupBy: List<ScalarExpression<*>> = emptyList(), having: ScalarExpression<Boolean>? = null, isDistinct: Boolean = false, orderBy: List<OrderByExpression> = emptyList(), offset: Int? = null, limit: Int? = null, tableAlias: String? = null, extraProperties: Map<String, Any> = emptyMap())

Properties

Link copied to clipboard

the selected column declarations, empty means select *.

Link copied to clipboard
open override val extraProperties: Map<String, Any>

Extra properties of this expression, maybe useful in SqlFormatter to generate some special SQLs.

Link copied to clipboard

the query's source, represents the from clause of SQL.

Link copied to clipboard

the grouping conditions, represents the group by clause of SQL.

Link copied to clipboard

the having condition, represents the having clause of SQL.

Link copied to clipboard
val isDistinct: Boolean = false

mark if this query is distinct, true means the SQL is select distinct ....

Link copied to clipboard
override val isLeafNode: Boolean = false

Check if this expression is a leaf node in expression trees.

Link copied to clipboard
open override val limit: Int? = null

max record numbers returned by the query.

Link copied to clipboard
open override val offset: Int? = null

the offset of the first returned record.

Link copied to clipboard
open override val orderBy: List<OrderByExpression>

a list of order-by expressions, used in the order by clause of a query.

Link copied to clipboard
open override val tableAlias: String? = null

the alias when this query is nested in another query's source, e.g. select * from (...) alias.

Link copied to clipboard

the filter condition, represents the where clause of SQL.