StmtJoin | R Documentation |
SQL JOIN statement.
SQL JOIN statement.
This class represents a SQL JOIN statement. It requires two fields on which to join, and the type of join to perform (inner, left, right, or full). The table on which to join is determined by looking at the two fields in order and using the first table name available.
sqlq::Statement
-> StmtJoin
new()
Initializer. To determine the table on which to join, we look at the both fields in order and use the first table name available.
StmtJoin$new(field1, field2, type = c("inner", "left", "right", "full"))
field1
The first field on which to join.
field2
The second field on which to join.
type
The type of join to perform. One of "inner", "left", "right", or "full". Defaults to "inner".
Nothing.
getTokens()
Generates the list of tokens representing this statement.
StmtJoin$getTokens()
A list of Token objects.
clone()
The objects of this class are cloneable with this method.
StmtJoin$clone(deep = FALSE)
deep
Whether to make a deep clone.
# Create an inner join (default join type) between table 'foo' and table
# 'bar':
join <- StmtJoin$new(ExprField$new("id", "foo"),
ExprField$new("foo_id", "bar"))
# Create a left join between table 'foo' and table 'bar':
join <- StmtJoin$new(ExprField$new("id", "foo"),
ExprField$new("foo_id", "bar"),
type = "left")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.