- All Superinterfaces:
QueryPart
,Serializable
,WindowSpecification
,WindowSpecificationFinalStep
- All Known Subinterfaces:
WindowDefinition
,WindowSpecificationOrderByStep
,WindowSpecificationPartitionByStep
An intermediate step in the construction of a Referencing
WindowSpecification
.
Example:
WindowSpecification spec =
DSL.partitionBy(BOOK.AUTHOR_ID)
.orderBy(BOOK.ID)
.rowsBetweenUnboundedPreceding()
.andCurrentRow();
Referencing XYZ*Step
types directly from client code
It is usually not recommended to reference any XYZ*Step
types
directly from client code, or assign them to local variables. When writing
dynamic SQL, creating a statement's components dynamically, and passing them
to the DSL API statically is usually a better choice. See the manual's
section about dynamic SQL for details: https://www.jooq.org/doc/latest/manual/sql-building/dynamic-sql.
Drawbacks of referencing the XYZ*Step
types directly:
- They're operating on mutable implementations (as of jOOQ 3.x)
- They're less composable and not easy to get right when dynamic SQL gets complex
- They're less readable
- They might have binary incompatible changes between minor releases
- Author:
- Lukas Eder
-
Method Summary
Modifier and TypeMethodDescription@NotNull WindowSpecificationRowsAndStep
Add aGROUPS BETWEEN CURRENT ROW …
frame clause to the window specification.@NotNull WindowSpecificationRowsAndStep
groupsBetweenFollowing
(int number) Add aGROUPS BETWEEN [number] FOLLOWING …
frame clause to the window specification.@NotNull WindowSpecificationRowsAndStep
groupsBetweenPreceding
(int number) Add aGROUPS BETWEEN [number] PRECEDING …
frame clause to the window specification.@NotNull WindowSpecificationRowsAndStep
Add aGROUPS BETWEEN UNBOUNDED FOLLOWING …
frame clause to the window specification.@NotNull WindowSpecificationRowsAndStep
Add aGROUPS BETWEEN UNBOUNDED PRECEDING …
frame clause to the window specification.@NotNull WindowSpecificationExcludeStep
Add aGROUPS CURRENT ROW
frame clause to the window specification.@NotNull WindowSpecificationExcludeStep
groupsFollowing
(int number) Add aGROUPS [number] FOLLOWING
frame clause to the window specification.@NotNull WindowSpecificationExcludeStep
groupsPreceding
(int number) Add aGROUPS [number] PRECEDING
frame clause to the window specification.@NotNull WindowSpecificationExcludeStep
Add aGROUPS UNBOUNDED FOLLOWING
frame clause to the window specification.@NotNull WindowSpecificationExcludeStep
Add aGROUPS UNBOUNDED PRECEDING
frame clause to the window specification.@NotNull WindowSpecificationRowsAndStep
Add aRANGE BETWEEN CURRENT ROW …
frame clause to the window specification.@NotNull WindowSpecificationRowsAndStep
rangeBetweenFollowing
(int number) Add aRANGE BETWEEN [number] FOLLOWING …
frame clause to the window specification.@NotNull WindowSpecificationRowsAndStep
rangeBetweenPreceding
(int number) Add aRANGE BETWEEN [number] PRECEDING …
frame clause to the window specification.@NotNull WindowSpecificationRowsAndStep
Add aRANGE BETWEEN UNBOUNDED FOLLOWING …
frame clause to the window specification.@NotNull WindowSpecificationRowsAndStep
Add aRANGE BETWEEN UNBOUNDED PRECEDING …
frame clause to the window specification.@NotNull WindowSpecificationExcludeStep
Add aRANGE CURRENT ROW
frame clause to the window specification.@NotNull WindowSpecificationExcludeStep
rangeFollowing
(int number) Add aRANGE [number] FOLLOWING
frame clause to the window specification.@NotNull WindowSpecificationExcludeStep
rangePreceding
(int number) Add aRANGE [number] PRECEDING
frame clause to the window specification.@NotNull WindowSpecificationExcludeStep
Add aRANGE UNBOUNDED FOLLOWING
frame clause to the window specification.@NotNull WindowSpecificationExcludeStep
Add aRANGE UNBOUNDED PRECEDING
frame clause to the window specification.@NotNull WindowSpecificationRowsAndStep
Add aROWS BETWEEN CURRENT ROW …
frame clause to the window specification.@NotNull WindowSpecificationRowsAndStep
rowsBetweenFollowing
(int number) Add aROWS BETWEEN [number] FOLLOWING …
frame clause to the window specification.@NotNull WindowSpecificationRowsAndStep
rowsBetweenPreceding
(int number) Add aROWS BETWEEN [number] PRECEDING …
frame clause to the window specification.@NotNull WindowSpecificationRowsAndStep
Add aROWS BETWEEN UNBOUNDED FOLLOWING …
frame clause to the window specification.@NotNull WindowSpecificationRowsAndStep
Add aROWS BETWEEN UNBOUNDED PRECEDING …
frame clause to the window specification.@NotNull WindowSpecificationExcludeStep
Add aROWS CURRENT ROW
frame clause to the window specification.@NotNull WindowSpecificationExcludeStep
rowsFollowing
(int number) Add aROWS [number] FOLLOWING
frame clause to the window specification.@NotNull WindowSpecificationExcludeStep
rowsPreceding
(int number) Add aROWS [number] PRECEDING
frame clause to the window specification.@NotNull WindowSpecificationExcludeStep
Add aROWS UNBOUNDED FOLLOWING
frame clause to the window specification.@NotNull WindowSpecificationExcludeStep
Add aROWS UNBOUNDED PRECEDING
frame clause to the window specification.Methods inherited from interface org.jooq.QueryPart
$replace, $replace, $traverse, $traverse, equals, hashCode, toString
Methods inherited from interface org.jooq.WindowSpecification
$exclude, $frameEnd, $frameStart, $frameUnits, $orderBy, $partitionBy, $windowDefinition
-
Method Details
-
rowsUnboundedPreceding
@NotNull @Support({AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,DB2,DUCKDB,EXASOL,FIREBIRD_4_0,H2,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER2012,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) @NotNull WindowSpecificationExcludeStep rowsUnboundedPreceding()Add aROWS UNBOUNDED PRECEDING
frame clause to the window specification. -
rowsPreceding
@NotNull @Support({AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,DB2,DUCKDB,EXASOL,FIREBIRD_4_0,H2,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER2012,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) @NotNull WindowSpecificationExcludeStep rowsPreceding(int number) Add aROWS [number] PRECEDING
frame clause to the window specification. -
rowsCurrentRow
@NotNull @Support({AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,DB2,DUCKDB,EXASOL,FIREBIRD_4_0,H2,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER2012,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) @NotNull WindowSpecificationExcludeStep rowsCurrentRow()Add aROWS CURRENT ROW
frame clause to the window specification. -
rowsUnboundedFollowing
@NotNull @Support({AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,DB2,DUCKDB,EXASOL,FIREBIRD_4_0,H2,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER2012,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) @NotNull WindowSpecificationExcludeStep rowsUnboundedFollowing()Add aROWS UNBOUNDED FOLLOWING
frame clause to the window specification. -
rowsFollowing
@NotNull @Support({AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,DB2,DUCKDB,EXASOL,FIREBIRD_4_0,H2,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER2012,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) @NotNull WindowSpecificationExcludeStep rowsFollowing(int number) Add aROWS [number] FOLLOWING
frame clause to the window specification. -
rowsBetweenUnboundedPreceding
@NotNull @Support({AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,DB2,DUCKDB,EXASOL,FIREBIRD_4_0,H2,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER2012,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) @NotNull WindowSpecificationRowsAndStep rowsBetweenUnboundedPreceding()Add aROWS BETWEEN UNBOUNDED PRECEDING …
frame clause to the window specification. -
rowsBetweenPreceding
@NotNull @Support({AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,DB2,DUCKDB,EXASOL,FIREBIRD_4_0,H2,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER2012,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) @NotNull WindowSpecificationRowsAndStep rowsBetweenPreceding(int number) Add aROWS BETWEEN [number] PRECEDING …
frame clause to the window specification. -
rowsBetweenCurrentRow
@NotNull @Support({AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,DB2,DUCKDB,EXASOL,FIREBIRD_4_0,H2,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER2012,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) @NotNull WindowSpecificationRowsAndStep rowsBetweenCurrentRow()Add aROWS BETWEEN CURRENT ROW …
frame clause to the window specification. -
rowsBetweenUnboundedFollowing
@NotNull @Support({AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,DB2,DUCKDB,EXASOL,FIREBIRD_4_0,H2,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER2012,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) @NotNull WindowSpecificationRowsAndStep rowsBetweenUnboundedFollowing()Add aROWS BETWEEN UNBOUNDED FOLLOWING …
frame clause to the window specification. -
rowsBetweenFollowing
@NotNull @Support({AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,DB2,DUCKDB,EXASOL,FIREBIRD_4_0,H2,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,REDSHIFT,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER2012,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) @NotNull WindowSpecificationRowsAndStep rowsBetweenFollowing(int number) Add aROWS BETWEEN [number] FOLLOWING …
frame clause to the window specification. -
rangeUnboundedPreceding
@NotNull @Support({AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,DB2,DUCKDB,EXASOL,FIREBIRD_4_0,H2,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER2012,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) @NotNull WindowSpecificationExcludeStep rangeUnboundedPreceding()Add aRANGE UNBOUNDED PRECEDING
frame clause to the window specification. -
rangePreceding
@NotNull @Support({AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,DB2,DUCKDB,EXASOL,FIREBIRD_4_0,H2,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER2012,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) @NotNull WindowSpecificationExcludeStep rangePreceding(int number) Add aRANGE [number] PRECEDING
frame clause to the window specification. -
rangeCurrentRow
@NotNull @Support({AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,DB2,DUCKDB,EXASOL,FIREBIRD_4_0,H2,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER2012,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) @NotNull WindowSpecificationExcludeStep rangeCurrentRow()Add aRANGE CURRENT ROW
frame clause to the window specification. -
rangeUnboundedFollowing
@NotNull @Support({AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,DB2,DUCKDB,EXASOL,FIREBIRD_4_0,H2,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER2012,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) @NotNull WindowSpecificationExcludeStep rangeUnboundedFollowing()Add aRANGE UNBOUNDED FOLLOWING
frame clause to the window specification. -
rangeFollowing
@NotNull @Support({AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,DB2,DUCKDB,EXASOL,FIREBIRD_4_0,H2,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER2012,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) @NotNull WindowSpecificationExcludeStep rangeFollowing(int number) Add aRANGE [number] FOLLOWING
frame clause to the window specification. -
rangeBetweenUnboundedPreceding
@NotNull @Support({AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,DB2,DUCKDB,EXASOL,FIREBIRD_4_0,H2,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER2012,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) @NotNull WindowSpecificationRowsAndStep rangeBetweenUnboundedPreceding()Add aRANGE BETWEEN UNBOUNDED PRECEDING …
frame clause to the window specification. -
rangeBetweenPreceding
@NotNull @Support({AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,DB2,DUCKDB,EXASOL,FIREBIRD_4_0,H2,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER2012,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) @NotNull WindowSpecificationRowsAndStep rangeBetweenPreceding(int number) Add aRANGE BETWEEN [number] PRECEDING …
frame clause to the window specification. -
rangeBetweenCurrentRow
@NotNull @Support({AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,DB2,DUCKDB,EXASOL,FIREBIRD_4_0,H2,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER2012,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) @NotNull WindowSpecificationRowsAndStep rangeBetweenCurrentRow()Add aRANGE BETWEEN CURRENT ROW …
frame clause to the window specification. -
rangeBetweenUnboundedFollowing
@NotNull @Support({AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,DB2,DUCKDB,EXASOL,FIREBIRD_4_0,H2,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER2012,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) @NotNull WindowSpecificationRowsAndStep rangeBetweenUnboundedFollowing()Add aRANGE BETWEEN UNBOUNDED FOLLOWING …
frame clause to the window specification. -
rangeBetweenFollowing
@NotNull @Support({AURORA_POSTGRES,BIGQUERY,CLICKHOUSE,COCKROACHDB,DB2,DUCKDB,EXASOL,FIREBIRD_4_0,H2,INFORMIX,MARIADB,MEMSQL,MYSQL_8_0,ORACLE,POSTGRES,SNOWFLAKE,SQLDATAWAREHOUSE,SQLITE,SQLSERVER2012,SYBASE,TERADATA,TRINO,VERTICA,YUGABYTEDB}) @NotNull WindowSpecificationRowsAndStep rangeBetweenFollowing(int number) Add aRANGE BETWEEN [number] FOLLOWING …
frame clause to the window specification. -
groupsUnboundedPreceding
@NotNull @Support({COCKROACHDB,EXASOL,H2,ORACLE20C,POSTGRES_11,SQLITE_3_28,TRINO,YUGABYTEDB}) @NotNull WindowSpecificationExcludeStep groupsUnboundedPreceding()Add aGROUPS UNBOUNDED PRECEDING
frame clause to the window specification. -
groupsPreceding
@NotNull @Support({COCKROACHDB,EXASOL,H2,ORACLE20C,POSTGRES_11,SQLITE_3_28,TRINO,YUGABYTEDB}) @NotNull WindowSpecificationExcludeStep groupsPreceding(int number) Add aGROUPS [number] PRECEDING
frame clause to the window specification. -
groupsCurrentRow
@NotNull @Support({COCKROACHDB,EXASOL,H2,ORACLE20C,POSTGRES_11,SQLITE_3_28,TRINO,YUGABYTEDB}) @NotNull WindowSpecificationExcludeStep groupsCurrentRow()Add aGROUPS CURRENT ROW
frame clause to the window specification. -
groupsUnboundedFollowing
@NotNull @Support({COCKROACHDB,EXASOL,H2,ORACLE20C,POSTGRES_11,SQLITE_3_28,TRINO,YUGABYTEDB}) @NotNull WindowSpecificationExcludeStep groupsUnboundedFollowing()Add aGROUPS UNBOUNDED FOLLOWING
frame clause to the window specification. -
groupsFollowing
@NotNull @Support({COCKROACHDB,EXASOL,H2,ORACLE20C,POSTGRES_11,SQLITE_3_28,TRINO,YUGABYTEDB}) @NotNull WindowSpecificationExcludeStep groupsFollowing(int number) Add aGROUPS [number] FOLLOWING
frame clause to the window specification. -
groupsBetweenUnboundedPreceding
@NotNull @Support({COCKROACHDB,EXASOL,H2,ORACLE20C,POSTGRES_11,SQLITE_3_28,TRINO,YUGABYTEDB}) @NotNull WindowSpecificationRowsAndStep groupsBetweenUnboundedPreceding()Add aGROUPS BETWEEN UNBOUNDED PRECEDING …
frame clause to the window specification. -
groupsBetweenPreceding
@NotNull @Support({COCKROACHDB,EXASOL,H2,ORACLE20C,POSTGRES_11,SQLITE_3_28,TRINO,YUGABYTEDB}) @NotNull WindowSpecificationRowsAndStep groupsBetweenPreceding(int number) Add aGROUPS BETWEEN [number] PRECEDING …
frame clause to the window specification. -
groupsBetweenCurrentRow
@NotNull @Support({COCKROACHDB,EXASOL,H2,ORACLE20C,POSTGRES_11,SQLITE_3_28,TRINO,YUGABYTEDB}) @NotNull WindowSpecificationRowsAndStep groupsBetweenCurrentRow()Add aGROUPS BETWEEN CURRENT ROW …
frame clause to the window specification. -
groupsBetweenUnboundedFollowing
@NotNull @Support({COCKROACHDB,EXASOL,H2,ORACLE20C,POSTGRES_11,SQLITE_3_28,TRINO,YUGABYTEDB}) @NotNull WindowSpecificationRowsAndStep groupsBetweenUnboundedFollowing()Add aGROUPS BETWEEN UNBOUNDED FOLLOWING …
frame clause to the window specification. -
groupsBetweenFollowing
@NotNull @Support({COCKROACHDB,EXASOL,H2,ORACLE20C,POSTGRES_11,SQLITE_3_28,TRINO,YUGABYTEDB}) @NotNull WindowSpecificationRowsAndStep groupsBetweenFollowing(int number) Add aGROUPS BETWEEN [number] FOLLOWING …
frame clause to the window specification.
-