开发者

Syntax Error (missing operator) in query expression?

hello and thanks in advance for any help.

I am getting an error: 'Syntax Error (missing operator) in query expression' and I do not know why... any ideas?

This is my query:

 UPDATE 
table1

SET 
table1.country_name = table2.COUNTRY,
table1.city = table2.CITY ,
table1.state = table2.STATE 

FROM
 ( table1 
i开发者_如何学运维nner join
table2 
ON
 table2.SITE_ID = table1.SiteID )

where
table1.country_name is null;


There is no FROM clause in an UPDATE query in Access/Jet SQL:

UPDATE table1 INNER JOIN table2 ON table1.SiteID = table2.SITE_ID
SET table1.country_name = table2.COUNTRY,
    table1.city = table2.CITY ,
    table1.state = table2.STATE 
WHERE table1.country_name is null;


Lose the parenthesis around the joined tables. In addition I would personally make an alias for table1 and table2 and reference the table1 alias in the update. Like this:

UPDATE t1
SET 
  t1.country_name = t2.COUNTRY,
  t1.city = t2.CITY,
  t1.state = t2.STATE 
FROM table1 t1 
INNER JOIN table2 t2 ON t2.SITE_ID = t1.SiteID
WHERE
  t1.country_name is null;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜