sql.select {RPgSQL} | R Documentation |
sql.select
is a wrapper for the SQL SELECT command.
sql.select(columns="*", into, from, where, group.by, having, order.by, limit, distinct=F, exec=T)
columns |
A list of column names |
into |
Put results into a new table with this name |
from |
Table name to select from |
where |
A logical expression |
group.by |
Group results by these columns |
having |
I'm not sure what this does |
order.by |
Sort results by these columns |
limit |
Only return this many rows |
offset |
Return rows beginning here (zero-based) |
distinct |
If true, only distinct results are returned |
exec |
If true, execute the query and return the results |
Table joins are impossible in sql.select
. You must use
db.execute
and hand edit the query to do a join.
select
is meant to save a few key strokes and perhaps avoid a
few typing errors.
If exec
is true, a data frame containing the results of the
query. If exec
is false, the formatted query string.
Timothy H. Keitt
sql.select("usename", from="pg_user", where="usename = 'postgres'", exec=F)