I would like to do a UPDATE with two tables on 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"))
The UPDATE is:
sqldf(paste("UPDATE x1"
," SET x1.h = 1"
," WHERE EXISTS (SELECT *"
," FROM x2"
," WHERE x1.id = x2.id"
," AND x1.t < x2.start"
," )"
)
)
I get the following error:
Error in sqliteExecStatement(con, statement, bind.data) :
RS-DBI driver: (error in statement: near ".": syntax error)
Has someone an idea what goes wrong? Thanks for helps.