StmtSelectFields | R Documentation |
SELECT fields statement.
SELECT fields statement.
This class represents a SQL SELECT statement with specific fields. It
requires a list of ExprField
instances representing the fields to select,
with optional distinct
keyword to remove duplicate results.
sqlq::Statement
-> sqlq::StmtSelect
-> StmtSelectFields
new()
Initializer
StmtSelectFields$new(fields, distinct = FALSE)
fields
A list of ExprField instances.
distinct
Set to TRUE enable distinct
keyword and remove
duplicate results.
Nothing.
getTokens()
Generates the list of tokens representing this statement.
StmtSelectFields$getTokens()
A list of Token objects.
clone()
The objects of this class are cloneable with this method.
StmtSelectFields$clone(deep = FALSE)
deep
Whether to make a deep clone.
# Create a SELECT statement with specific fields:
field1 <- ExprField$new("title", "books")
field2 <- ExprField$new("name", "authors")
select_fields <- StmtSelectFields$new(fields = list(field1, field2))
# Use the created SELECT statement inside a SELECT query:
query <- QuerySelect$new(select = select_fields,
from = StmtFrom$new("books"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.