sqlFullLeftJoin: Merge SQL Queries to One Query That Performs a Full Left Join

View source: R/sql_join.R

sqlFullLeftJoinR Documentation

Merge SQL Queries to One Query That Performs a Full Left Join

Description

Merge SQL Queries to One Query That Performs a Full Left Join

Usage

sqlFullLeftJoin(sqls, key)

Arguments

sqls

list of SQL queries each of which is expected to contain an attribute alias giving the alias name for the query

key

name of the primary key field, being selected in each SQL query contained in sqls

Value

vector of character of length one representing the result of "left join"-ing all sub-queries given in sqls

Examples

sql <- sqlFullLeftJoin(key = "id", list(
  structure("SELECT id, field_1 from table_1", alias = "t1"),
  structure("SELECT id, field_2, field_3 from table_2", alias = "t2"),
  structure("SELECT id, field_4 from table_3", alias = "t3")
))

cat(sql)


KWB-R/kwb.db documentation built on Oct. 1, 2023, 4:10 a.m.