Lag

class Lag<T>(val expr: ExpressionWithColumnType<T>, val offset: ExpressionWithColumnType<Int> = intLiteral(1), val defaultValue: ExpressionWithColumnType<T>? = null) : WindowFunction<T?>

Represents an SQL function that returns value evaluated at the row that is offset rows before the current row within the partition; if there is no such row, instead returns defaultValue.

Constructors

Link copied to clipboard
constructor(expr: ExpressionWithColumnType<T>, offset: ExpressionWithColumnType<Int> = intLiteral(1), defaultValue: ExpressionWithColumnType<T>? = null)

Properties

Link copied to clipboard

Returns value that is used if no row found at such offset.

Link copied to clipboard

Returns the expression from which the rows are counted.

Link copied to clipboard

Returns number of rows before the current row.

Functions

Link copied to clipboard
open override fun over(): WindowFunctionDefinition<T?>

Returns window function definition.

Link copied to clipboard
open override fun toQueryBuilder(queryBuilder: QueryBuilder)

Appends the SQL representation of this function to the specified queryBuilder.