View source: R/sql_expressions.R
| hsSqlExOr | R Documentation | 
Creates a boolean expression of the form 
 bFunc(x1) OR bFunc(x2) OR 
... OR bFunc(xn). This function can be used to create SQL queries where many
table fields have to be checked in the same way for some criterion (see
example).
hsSqlExOr(x, bFunc = "")
x | 
 vector of strings, e.g. representing table field names.  | 
bFunc | 
 name of a boolean function to be “applied” to each element of x.  | 
hsSqlExAnd
## Build SQL query finding records in table t in which at least
## one of the table fields f1 to f100 is NULL.
sql <- sprintf("SELECT * FROM t WHERE %s", 
               hsSqlExOr(paste("f", 1:100, sep = ""), "isNull"))
  
## Show the SQL string
sql
  
## Output (middle part omitted):
# SELECT * FROM t WHERE (FALSE) OR isNull(f1) OR 
# isNull(f2) OR isNull(f3) OR ... OR isNull(f100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.