English | 简体中文

api-docs / org.ktorm.expression / WindowSpecificationExpression

WindowSpecificationExpression

data class WindowSpecificationExpression : SqlExpression (source code)

Window specification expression.

Constructors

NameSummary

<init>

WindowSpecificationExpression(
    partitionBy: List<ScalarExpression<*>> = emptyList(),
    orderBy: List<OrderByExpression> = emptyList(),
    frameUnit: WindowFrameUnitType? = null,
    frameStart: WindowFrameBoundExpression? = null,
    frameEnd: WindowFrameBoundExpression? = null,
    isLeafNode: Boolean = false,
    extraProperties: Map<String, Any> = emptyMap())

Window specification expression.

Properties

NameSummary

extraProperties

val extraProperties: Map<String, Any>

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

frameEnd

end bound of the window frame.

frameStart

start bound of the window frame.

frameUnit

val frameUnit: WindowFrameUnitType?

frame unit indicates the type of relationship between the current row and frame rows.

isLeafNode

val isLeafNode: Boolean

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

orderBy

val orderBy: List<OrderByExpression>

order-by clause indicates how to sort rows in each partition.

partitionBy

val partitionBy: List<ScalarExpression<*>>

partition-by clause indicates how to divide the query rows into groups.

Extension Functions

NameSummary

eq

infix fun <T : Any> T.eq(
    expr: ColumnDeclaring<T>
): BinaryExpression<Boolean>

Equal operator, translated to = in SQL.

neq

infix fun <T : Any> T.neq(
    expr: ColumnDeclaring<T>
): BinaryExpression<Boolean>

Not-equal operator, translated to <> in SQL.

notEq

infix fun <T : Any> T.notEq(
    expr: ColumnDeclaring<T>
): BinaryExpression<Boolean>

Not-equal operator, translated to <> in SQL.

orderBy


Specify the order-by clause of this window using the given order-by expressions.

partitionBy


Specify the partition-by clause of this window using the given columns or expressions.

range

Specify the frame clause of this window using the given bound in range unit.

rangeBetween

Specify the frame clause of this window using the given bounds (start & end) in rows unit.

rows

Specify the frame clause of this window using the given bound in rows unit.

rowsBetween

Specify the frame clause of this window using the given bounds (start & end) in rows unit.