make_join: Create a SQL JOIN statement.

View source: R/factories.R

make_joinR Documentation

Create a SQL JOIN statement.

Description

Create a StmtJoin instance.

Usage

make_join(
  field1,
  table1,
  field2,
  table2 = NULL,
  type = c("inner", "left", "right", "full")
)

Arguments

field1

The first field on which to join.

table1

The table name of the first field.

field2

The second field on which to join.

table2

The table name of the second field (optional).

type

The type of join to perform. One of "inner", "left", "right", or "full". Defaults to "inner".

Value

An instance of StmtJoin.

Examples

# To generate a JOIN statement joining the "author_id" field of the "books"
# table with the "id" field of the "authors" table:
join <- make_join("author_id", "books", "id", "authors")


sqlq documentation built on Sept. 16, 2025, 9:10 a.m.