Generate SQL SELECT statement#'

sqlForSelect(
  tablename,
  fields = "*",
  whereClause = "TRUE",
  groupBy = "",
  orderBy = "",
  sqlDialect = getCurrentSqlDialect()
)

Arguments

tablename

table name

fields

expression to select fields; field names are separated by comma and alias names may be used, just as SQL accepts, e.g.: "tstamp as myDateTime, parVal as myValue"; Default: "*"

whereClause

where condition; Default: "TRUE"

groupBy

GROUP BY-clause, Default: "" (no grouping)

orderBy

ORDER BY-clause, Default: "" (no sorting of results)

sqlDialect

one of c("mysql", "msaccess")