有两个表:SPEC1、tmpDOT
SPEC1种一列为:HIGH
tmpDOT共有两个:OLD、NEW
两个表的内容大概如下:
SPEC1:
... HIGH ...
... A ...
... B ...
... A ...
... C ...
... B ...
... D ...
tmpDOT:
OLD NEW
A newA
B newB
方法三
SPEC1种一列为:HIGH
tmpDOT共有两个:OLD、NEW
两个表的内容大概如下:
SPEC1:
... HIGH ...
... A ...
... B ...
... A ...
... C ...
... B ...
... D ...
tmpDOT:
OLD NEW
A newA
B newB
C newC
方法一
update a set HIGH=b.NEW from SPEC1 a,tmpDOT b
where a.high=b.old
UPDATE A
SET HIGH=B.NEW
FROM A LEFT JOIN B ON (A.HIGH=B.OLD)
方法三
update a
set high = (select new from tmpdot where old=a.high )
from spec1 a