我刚才在ACCESS版块中先发了这个贴,但是看那里面好像人很少,所以又放在这里了,抱歉,不是故意乱发贴
update table1 set col1 =b.col1 from table1 a inner join table2 b on a.id=b.id
在SQL SERVER中我经常写这种语句,以b表中的某个字段的值来更新a表中的某个这段,但是这种写法在ACCESS中写时出错,提示语法错误 ,请大家帮我,该怎么写法?
------解决思路----------------------
-- LZ 试试这个语法。
update table1 ,table2
set table1.col1 = table2.col1
where a.id=b.id
------解决思路----------------------
试一下下面的sql
update a set col1 =b.col1 from table1 a ,table2 b where a.id=b.id
------解决思路----------------------
UPDATE A INNER JOIN B ON A.id = B.id SET A.col1 = b.col1;
------解决思路----------------------
试一下:
update table1 a set col1 =b.col1 from table1 a, table2 b where a.id = b.id
------解决思路----------------------
电脑上都没装这东西了。
语法:没有from关键字
UPDATE table
SET newvalue
WHERE criteria