sql_list: SQL List

View source: R/sql_list.R

sql_listR Documentation

SQL List

Description

Format an atomic vector for use with a SQL 'IN' statements

Usage

sql_list(x, quote = TRUE, wildcard = FALSE)

Arguments

x

Atomic character or numeric vector

quote

Should each entry be surrounded with single quotes?

wildcard

Should each entry be surrounded with percent signs? Used for wildcard matching

Author(s)

Sven Halvorson (svenpubmail@gmail.com)

Examples

paste(
  'SELECT nonsense',
  'FROM your_table',
  'WERE nonsense LIKE ANY',
  sql_list(letters[1:5], wildcard = TRUE),
  ';'
)

svenhalvorson/SvenR documentation built on Aug. 25, 2023, 1:31 p.m.