在R 3.3.3中运行SQLDF查询时,为什么会遇到错误?
我正在运行sqldf
使用with子句在r 3.6.3中正常运行的子句,但在r 3.3.3中不正常。
使用R 3.6.3的结果:
sqldf("WITH cte_a AS (SELECT cyl, avg(mpg) FROM mtcars group by cyl) SELECT * from cte_a")
# cyl avg(mpg)
#1 4 26.66364
#2 6 19.74286
#3 8 15.10000
使用R 3.3.3的结果:
sqldf("WITH cte_a AS (SELECT cyl, avg(mpg) FROM mtcars group by cyl) SELECT * from cte_a")
#-----
Loading required package: tcltk
Error in rsqlite_send_query(conn@ptr, statement) :
near "WITH": syntax error
In addition: Warning message:
Quoted identifiers should have class SQL, use DBI::SQL() if the caller performs the quoting.
任何帮助获得R 3.3.3查询工作的任何帮助将不胜感激。
I am running sqldf
using a WITH clause that works fine in R 3.6.3 but not in R 3.3.3.
Results using R 3.6.3:
sqldf("WITH cte_a AS (SELECT cyl, avg(mpg) FROM mtcars group by cyl) SELECT * from cte_a")
# cyl avg(mpg)
#1 4 26.66364
#2 6 19.74286
#3 8 15.10000
Results using R 3.3.3:
sqldf("WITH cte_a AS (SELECT cyl, avg(mpg) FROM mtcars group by cyl) SELECT * from cte_a")
#-----
Loading required package: tcltk
Error in rsqlite_send_query(conn@ptr, statement) :
near "WITH": syntax error
In addition: Warning message:
Quoted identifiers should have class SQL, use DBI::SQL() if the caller performs the quoting.
Any help getting the R 3.3.3 query to work would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论