Interface TableAsofJoinStep<R extends Record>
ASOF JOIN
clause, where a match condition must be added using
match(Condition) (corresponding to e.g. the
MATCH_CONDITION clause in Snowflake, or MATCH in
Trino).
The match condition must be a single comparison predicate of the form
[lhs expression] [comparator] [rhs expression], where
[comparator] is any of <, <=,
>, >=. It specifies which row is the
"nearest" row from the right hand side for each row of the left hand side:
>or>=: The row with the greatest[rhs expression]that is still less than (or equal to)[lhs expression].<or<=: The row with the least[rhs expression]that is still greater than (or equal to)[lhs expression].
Additional (usually equality) predicates can be supplied using
ON or USING after the match condition.
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 TableOptionalOnStep<R> Add a match condition to theASOF JOIN.@NotNull TableOptionalOnStep<R> Add a match condition to theASOF JOIN.@NotNull TableOptionalOnStep<R> Add a match condition to theASOF JOIN.@NotNull TableOptionalOnStep<R> Add a match condition to theASOF JOIN.@NotNull TableOptionalOnStep<R> Add a match condition to theASOF JOIN.@NotNull TableOptionalOnStep<R> Add a match condition to theASOF JOIN.
-
Method Details
-
match
@NotNull @Support({AURORA_POSTGRES,CLICKHOUSE,COCKROACHDB,DATABRICKS,DB2,DUCKDB,FIREBIRD_4_0,HANA,MYSQL_8_0,ORACLE12C,POSTGRES_9_3,SNOWFLAKE,SQLDATAWAREHOUSE,SQLSERVER,SYBASE,TRINO,YUGABYTEDB}) @NotNull TableOptionalOnStep<R> match(Condition condition) Add a match condition to theASOF JOIN. -
match
@NotNull @Support({AURORA_POSTGRES,CLICKHOUSE,COCKROACHDB,DATABRICKS,DB2,DUCKDB,FIREBIRD_4_0,HANA,MYSQL_8_0,ORACLE12C,POSTGRES_9_3,SNOWFLAKE,SQLDATAWAREHOUSE,SQLSERVER,SYBASE,TRINO,YUGABYTEDB}) @NotNull TableOptionalOnStep<R> match(Field<Boolean> condition) Add a match condition to theASOF JOIN. -
match
@NotNull @Support({AURORA_POSTGRES,CLICKHOUSE,COCKROACHDB,DATABRICKS,DB2,DUCKDB,FIREBIRD_4_0,HANA,MYSQL_8_0,ORACLE12C,POSTGRES_9_3,SNOWFLAKE,SQLDATAWAREHOUSE,SQLSERVER,SYBASE,TRINO,YUGABYTEDB}) @PlainSQL @NotNull TableOptionalOnStep<R> match(SQL sql) Add a match condition to theASOF JOIN.NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!
Plain SQL match conditions cannot be emulated in dialects that do not support
ASOF JOINnatively.- See Also:
-
match
@NotNull @Support({AURORA_POSTGRES,CLICKHOUSE,COCKROACHDB,DATABRICKS,DB2,DUCKDB,FIREBIRD_4_0,HANA,MYSQL_8_0,ORACLE12C,POSTGRES_9_3,SNOWFLAKE,SQLDATAWAREHOUSE,SQLSERVER,SYBASE,TRINO,YUGABYTEDB}) @PlainSQL @NotNull TableOptionalOnStep<R> match(@SQL String sql) Add a match condition to theASOF JOIN.NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!
Plain SQL match conditions cannot be emulated in dialects that do not support
ASOF JOINnatively.- See Also:
-
match
@NotNull @Support({AURORA_POSTGRES,CLICKHOUSE,COCKROACHDB,DATABRICKS,DB2,DUCKDB,FIREBIRD_4_0,HANA,MYSQL_8_0,ORACLE12C,POSTGRES_9_3,SNOWFLAKE,SQLDATAWAREHOUSE,SQLSERVER,SYBASE,TRINO,YUGABYTEDB}) @PlainSQL @NotNull TableOptionalOnStep<R> match(@SQL String sql, Object... bindings) Add a match condition to theASOF JOIN.NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!
Plain SQL match conditions cannot be emulated in dialects that do not support
ASOF JOINnatively.- See Also:
-
match
@NotNull @Support({AURORA_POSTGRES,CLICKHOUSE,COCKROACHDB,DATABRICKS,DB2,DUCKDB,FIREBIRD_4_0,HANA,MYSQL_8_0,ORACLE12C,POSTGRES_9_3,SNOWFLAKE,SQLDATAWAREHOUSE,SQLSERVER,SYBASE,TRINO,YUGABYTEDB}) @PlainSQL @NotNull TableOptionalOnStep<R> match(@SQL String sql, QueryPart... parts) Add a match condition to theASOF JOIN.NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!
Plain SQL match conditions cannot be emulated in dialects that do not support
ASOF JOINnatively.- See Also:
-