StmtWhere: SQL WHERE statement.

StmtWhereR Documentation

SQL WHERE statement.

Description

SQL WHERE statement.

SQL WHERE statement.

Details

This class represents a SQL WHERE statement, used to filter results in SELECT, UPDATE, and DELETE statements.

Super class

sqlq::Statement -> StmtWhere

Methods

Public methods

Inherited methods

Method new()

Initializer.

Usage
StmtWhere$new(expr)
Arguments
expr

The expression to evaluate.

Returns

Nothing.


Method getTokens()

Generates the list of tokens representing this statement.

Usage
StmtWhere$getTokens()
Returns

A list of Token objects.


Method clone()

The objects of this class are cloneable with this method.

Usage
StmtWhere$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

# 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)


sqlq documentation built on Sept. 16, 2025, 9:10 a.m.