ORACLE 批量更新语句原创
269次浏览
编辑于2021年06月07日 18:45:16
MERGE INTO KDY_FA_DEPRECIATION T1
USING(
SELECT A.FALTERID,A.FNUMBER,B.FENTRYID,B.FDPPROJECT,B.FDPPROJECTNAME,D.FNAME FROM T_FA_CARD A INNER JOIN KDY_FA_DEPRECIATION B ON A.FALTERID = B.FALTERID
INNER JOIN T_BD_DEPARTMENT C ON B.FDPPROJECT = C.FDEPTID INNER JOIN T_BD_DEPARTMENT_L D ON C.FDEPTID = D.FDEPTID
WHERE A.FISNEWREC = '2' AND A.FASSETORGID = 1 AND A.FDISPOSALTYPE = 0 AND B.FDPPROJECT IS NOT NULL AND B.FDPPROJECTNAME =' '
) T2
ON(T1.FENTRYID = T2.FENTRYID)
WHEN MATCHED THEN
UPDATE SET T1.FDPPROJECTNAME = T2.FNAME;
USING(
SELECT A.FALTERID,A.FNUMBER,B.FENTRYID,B.FDPPROJECT,B.FDPPROJECTNAME,D.FNAME FROM T_FA_CARD A INNER JOIN KDY_FA_DEPRECIATION B ON A.FALTERID = B.FALTERID
INNER JOIN T_BD_DEPARTMENT C ON B.FDPPROJECT = C.FDEPTID INNER JOIN T_BD_DEPARTMENT_L D ON C.FDEPTID = D.FDEPTID
WHERE A.FISNEWREC = '2' AND A.FASSETORGID = 1 AND A.FDISPOSALTYPE = 0 AND B.FDPPROJECT IS NOT NULL AND B.FDPPROJECTNAME =' '
) T2
ON(T1.FENTRYID = T2.FENTRYID)
WHEN MATCHED THEN
UPDATE SET T1.FDPPROJECTNAME = T2.FNAME;
赞 0
0人点赞
还没有人点赞,快来当第一个点赞的人吧!
打赏
0人打赏
还没有人打赏,快来当第一个打赏的人吧!
推荐阅读