我想对 sqlite 上的两个表进行更新。
x1 <- data.frame(id = rep(1,3),
t = as.Date(c("2000-01-01","2000-01-15","2000-01-31"))
)
x1.h <- 0
x2 <- data.frame(id = 1, start = as.Date("2000-01-14"))
更新是:
sqldf(paste("UPDATE x1"
," SET x1.h = 1"
," WHERE EXISTS (SELECT *"
," FROM x2"
," WHERE x1.id = x2.id"
," AND x1.t < x2.start"
," )"
)
)
我收到以下错误:
Error in sqliteExecStatement(con, statement, bind.data) :
RS-DBI driver: (error in statement: near ".": syntax error)
有人知道出了什么问题吗?感谢您的帮助。