Build a query the joins 2 tables, respectively aliased as a and b in the query itself.

build_join_query(
  select_table_fields = "*",
  select_join_on_fields = "*",
  distinct = FALSE,
  schema,
  table,
  column,
  join_on_schema,
  join_on_table,
  join_on_column,
  kind = c("LEFT", "RIGHT", "INNER", "FULL"),
  where_in_field,
  where_in_vector,
  where_in_join_on_field,
  where_in_join_on_vector,
  where_not_in_field,
  where_not_in_vector,
  where_not_in_join_on_field,
  where_not_in_join_on_vector,
  where_is_null_field,
  where_is_not_null_field,
  where_is_null_join_on_field,
  where_is_not_null_join_on_field,
  case_insensitive,
  limit,
  random
)

Arguments

select_table_fields

The fields to select for in the first table

select_join_on_fields

The fields to select for in the table being join to the first table

distinct

If TRUE, the distinct row count will be returned.

schema

The target schema for the operation.

table

Target table for the operation.

column

Column to join on.

join_on_schema

Schema of the table that is being joined to the first table.

join_on_table

Table that is being joined to the first table.

join_on_column

Column in the join_on_table that is joined onto the column of the first table.

kind

Type of join. Defaults to left, and options include "LEFT", "RIGHT", "INNER", or "FULL"

where_in_field

Paired with where_in_vector, adds a "WHERE field IN (vector)" clause to the query corresponding to the field-value pair.

where_not_in_field

Paired with where_not_in_vector, adds a "WHERE field NOT IN (vector)" clause to the query corresponding to the field-value pair.

case_insensitive

If TRUE, both sides of the query are converted to lowercase.

limit

(Optional) Integer of the row limit. Takes precedence over random if both arguments are provided.

random

(Optional) Integer of the random number of rows to return. Is preceded by limit if both limit and random are provided.

See also