add_join_paths_to_query {acdcquery}R Documentation

Add Join Paths to Query

Description

This function generates an SQL query based on a specified connection, argument, and join path list. It constructs a query that performs joins on multiple tables according to the provided join path, incorporating requested variables and filter conditions as needed.

Usage

add_join_paths_to_query(
  conn,
  filter_statements,
  join_path_list,
  argument_sequence,
  requested_vars = NULL
)

Arguments

conn

The connection object or database connection string.

filter_statements

The SQL-Filter statements extracted from the filter arguments list via 'get_filter_statement()'.

join_path_list

A list representing the join path. Each element of the list should be a data frame describing a step in the join path with columns: "table_to_join", "method", and "common_var".

argument_sequence

A numeric vector representing the AND/OR sequence of arguments.

requested_vars

A character vector specifying the variables to be selected from the final query result. If NULL, all variables are selected.

Value

A SQL query string that represents the joined tables and requested variables.


[Package acdcquery version 1.0.1 Index]