View source: R/extract_alias.R
extract_alias | R Documentation |
Extracts the column alias assignment from an expression used in
the SELECT
list of a SQL query
extract_alias(expr)
expr |
a character string containing a SQL expression which might have a column alias assignment at the end |
The expression must not contain any unquoted whitespace characters
except spaces, and there must be no unquoted runs or two or more spaces.
Use squish_sql
to satisfy this whitespace requirement.
queryparser also uses this function internally to extract table aliases
used in the FROM
clause.
a character string containing the inputted SQL expression with the column alias assignment removed (if it existed) and with the assigned alias as its name
expr <- "round(AVG(arr_delay)) AS avg_delay" extract_alias(expr)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.