StmtWhere | R Documentation |
SQL WHERE statement.
SQL WHERE statement.
This class represents a SQL WHERE statement, used to filter results in SELECT, UPDATE, and DELETE statements.
sqlq::Statement
-> StmtWhere
new()
Initializer.
StmtWhere$new(expr)
expr
The expression to evaluate.
Nothing.
getTokens()
Generates the list of tokens representing this statement.
StmtWhere$getTokens()
A list of Token objects.
clone()
The objects of this class are cloneable with this method.
StmtWhere$clone(deep = FALSE)
deep
Whether to make a deep clone.
# Create a WHERE statement with a simple expression:
expr <- ExprBinOp$new(ExprValue$new("age"), ">=", ExprValue$new(18))
where <- StmtWhere$new(expr)
# Use the created WHERE statement inside a SELECT query:
query <- QuerySelect$new(StmtSelectAll$new(),
from = StmtFrom$new("users"))
query$add(where)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.