在R中工作,并尝试通过使用以下代码运行与第二个表的左连接来向现有的MonetDBLite表添加一列:
dbSendQuery(mdb, "UPDATE table1
SET table1.variable = table2.variable
FROM table1 LEFT JOIN table2 ON table1.identifier = table2.identifier;")返回错误:
Server says 'syntax error, unexpected '.', expecting '=' in: "update table1
set table1."MonetDB不支持点分隔符引用表中的字段吗?非常感谢你的见解。
发布于 2016-11-16 21:46:22
提出了一种解决方法,即创建第三个表,而不是更新现有的表,然后删除原始表。(我很确定有一种更优雅的方法可以做到这一点,但是...)
dbSendQuery(db, "create table table3 as
select a.*,
b.variable
from table1 as a
left join table2 as b
on
(a.identifier = b.identifier);")
dbRemoveTable(db, "table2")https://stackoverflow.com/questions/40511194
复制相似问题