How to use EXTRACT through dbplyr when connecting to an Oracle DB
问题 Take this query: SELECT EXTRACT(month FROM order_date) "Month" FROM orders (simplified example from official oracle doc) How would you go at integrating such EXTRACT operations above in a dbplyr chain ? I'm open to any other workaround (even ugly/costly) to extract the month on server side. 回答1: More elegant: tbl(con, "orders") %>% mutate(Month = extract(NULL %month from% order_date)) This results in the following SQL (ANSI SQL): EXTRACT( MONTH FROM "order_date") This trick works because the