我的代码有什么问题?
第15级,州1,第2行的消息102 '('附近的语法不正确。
第18级州立18行第102条消息 “ UP”附近的语法不正确。
SQL服务器说缺少一些内容
UPDATE
(
SELECT
T.Br, U.Br AS Br1 ,
T.Dis, U.Dis AS Disc1 ,
T.DeletedDate , U.DeletedDate AS DeletedDate1 ,
T.INSERT_TS, U.INSERT_TS AS INSERT_TS1
FROM dbo.Matrix T
JOIN tlt_svs.Matrix_Update U
ON T.Key= U.Key)UP
SET
UP.Br = UP.Br1 ,
UP.Dis = UP.Dis1 ,
UP.DeletedDate = UP.DeletedDate1 ,
UP.INSERT_TS = UP.INSERT_TS1
答案 0 :(得分:0)
也许您想要一个UPDATE
进行连接,即用相应的matrix
值更新matrix_update
的值?
UPDATE m
SET m.br = mu.br,
m.dis = mu.dis,
m.deleteddate = mu.deleteddate,
m.insert_ts = mu.insert_ts
FROM dbo.matrix m
INNER JOIN tlt_svs.matrix_update mu
ON mu.key = m.key;