-1

再会

我正在尝试运行更新查询,但收到以下错误“连接操作中的语法错误”这是查询:

update (table 1 

set SEQ=table2.SEQ) 

from (table1 inner join table2 on table1.NBR=table2.NBR and table1.LINE = table2.LINE and table1.VENNO = table2.VENNO and table1.INVNO = table2.INVNO where table1.SEQ <> table2.seq)

任何帮助将不胜感激。

4

1 回答 1

1

你的语法是错误的。UPDATE查询不使用FROM. 正确的语法是:

update 
    table1
    inner join table2 
        on table1.NBR=table2.NBR 
           and table1.LINE = table2.LINE 
           and table1.VENNO = table2.VENNO 
           and table1.INVNO = table2.INVNO
 set
     table1.SEQ = table2.SEQ
 where 
     table1.SEQ <> table2.seq
于 2013-08-14T17:05:22.510 回答