unqualify_query {queryparser} | R Documentation |
Unqualifies column references in the clauses of a parsed SQL
SELECT
statement that begin with any of the specified prefixes
followed by a dot
unqualify_query(tree, prefixes, except = character(0))
tree |
a list returned by |
prefixes |
a character vector containing one or more table names or table aliases |
except |
a character vector containing column references to leave as is (optional) |
In the returned list, the FROM
clause is unmodified and
column alias assignments made in the SELECT
clause are unmodified.
A list the same as tree
but with all column references in the
SELECT
, WHERE
, GROUP BY
, HAVING
, and
ORDER BY
clauses unqualified, except those in except
my_query <- "SELECT f.flight,
manufacturer, p.model
FROM flights f
JOIN planes p USING (tailnum);"
unqualify_query(
parse_query(my_query),
prefixes = c("p", "f")
)