我想从另一个表中更新一个表的列
UPDATE tbl_relations SET tbl_relations.WANTED = table_wanted.WANTED FROM table_wanted , tbl_relations WHERE table_wanted.M_V_NO = tbl_relations.M_V_NO
SQLite管理器中的错误消息是
near ".": syntax error:
答案 0 :(得分:0)
尝试以下内容(适用于带有虚假数据的SQLite):
UPDATE tbl_relations
SET tbl_relations.WANTED = (SELECT w.WANTED
FROM table_wanted w
WHERE w.M_V_NO = tbl_relations.M_V_NO)
WHERE tbl_relations.M_V_NO IN (SELECT w.M_V_NO
FROM table_wanted w
WHERE w.M_V_NO = tbl_relations.M_V_NO)
希望有所帮助。