日期:2014-05-16 浏览次数:20515 次
update test2 set test2.dScore=isnull((select test1.dScore
from test1
where test2.cName=test1.cName and test2.cKecheng=test1.cKecheng),0)
where test2.cName=test1.cName and test2.cKecheng=test1.cKecheng
UPDATE test2
SET test2.dscore = ISNULL(test1.sScore)
FROM test1
WHERE test2.cName = test1.cName
AND test2.cKecheng = test1.cKecheng
UPDATE test2
SET test2.dScore=ISNULL(test1.dScore ,0)
FROM test1
WHERE test2.cName=test1.cName and test2.cKecheng=test1.cKecheng
--試試以下:
UPDATE test2 SET dScore = ISNULL(test1.dScore, 0)
from test2
LEFT JOIN test1 on test2.cName = test1.cName AND test2.cKecheng = test1.cKecheng