Table of Contents

Interface WindowFunctionBuilder.IBoundaryPart<TBoundaryDefined>

Namespace
LinqToDB
Assembly
linq2db.dll

Provides frame boundary options: UNBOUNDED, CURRENT ROW, or a directed value offset.

public interface WindowFunctionBuilder.IBoundaryPart<TBoundaryDefined>

Type Parameters

TBoundaryDefined
Extension Methods

Properties

CurrentRow

Specifies CURRENT ROW boundary.

TBoundaryDefined CurrentRow { get; }

Property Value

TBoundaryDefined

Unbounded

Specifies UNBOUNDED PRECEDING (start) or UNBOUNDED FOLLOWING (end) boundary.

TBoundaryDefined Unbounded { get; }

Property Value

TBoundaryDefined

Methods

ValueFollowing(object?)

Specifies an N FOLLOWING value offset boundary. Valid at either the start or the end of the frame.

TBoundaryDefined ValueFollowing(object? offset)

Parameters

offset object

Returns

TBoundaryDefined

Remarks

Syntax: <offset> FOLLOWING
C# usage:

// ROWS BETWEEN 1 FOLLOWING AND 3 FOLLOWING
Sql.Window.Sum(t.Value, f => f.OrderBy(t.Id).RowsBetween.ValueFollowing(1).And.ValueFollowing(3))

Generated SQL:

SUM(t.Value) OVER (ORDER BY t.Id ROWS BETWEEN 1 FOLLOWING AND 3 FOLLOWING)

ValuePreceding(object?)

Specifies an N PRECEDING value offset boundary. Valid at either the start or the end of the frame.

TBoundaryDefined ValuePreceding(object? offset)

Parameters

offset object

Returns

TBoundaryDefined

Remarks

Syntax: <offset> PRECEDING
C# usage:

// ROWS BETWEEN 5 PRECEDING AND 2 PRECEDING
Sql.Window.Sum(t.Value, f => f.OrderBy(t.Id).RowsBetween.ValuePreceding(5).And.ValuePreceding(2))

Generated SQL:

SUM(t.Value) OVER (ORDER BY t.Id ROWS BETWEEN 5 PRECEDING AND 2 PRECEDING)