Key matching conditions
- Equality condition: so called ‘equi joins’.
- You will use this most of the time.
- All others are sometimes called ‘non-equi joins’
- Inequality conditions:
- inequality joins:
join_by(id < id)
- rolling joins (only closest):
join_by(closest(id < id))
- overlap joins: to set interval conditions
between(x, y_lower, y_upper)
is short for x >= y_lower, x <= y_upper
within(x_lower, x_upper, y_lower, y_upper)
is short for x_lower >= y_lower, x_upper <= y_upper
overlaps(x_lower, x_upper, y_lower, y_upper)
is short for x_lower <= y_upper, x_upper >= y_lower
- No conditions: cross joins.
Use separate function
cross_join()
.