db2 sql批量插入一张表插入另一张表

INSERT INTO EQU.T_EQ_PERSONTEAM(EQ_PERSONTEAMID, FACTORYID,org_ID,PERSON_ID,TEAMID,POSTTYPE,POSTID,ISVALID,remark,LASTOPERATOR,LASTOPERATETIME) 
(SELECT 
lower(sys_guid()) EQ_PERSONTEAMID,
0 FACTORYID,
person.AREAID org_ID,
person.ID PERSON_ID,
0 TEAMID,
post.POSTTYPE POSTTYPE,
person.postid postid,
person.isused ISVALID,
'' remark
FROM pub.PERSON person
LEFT JOIN PUB.POST post  ON person.POSTID=POST.ID
WHERE  person.ID NOT IN (SELECT PERSON_ID FROM EQU.T_EQ_PERSONTEAM))
 

上一篇:DB2 获取前两天的数据


下一篇:DB2重启数据库实例