时间:2021-07-01 10:21:17 帮助过:46人阅读
INSERT INTO DataAnalysis_HrmDataHistory (estate,lockstate,delestate,creator,created,modifier,modified,name,employeeCode,sex,department_id,place_id,onDutyTime,outDutyTime,isDimission,birthday) SELECT estate,lockstate,delestate,creator,created,modifier,modified,chineseName,employeeCode,sex,department_id,subCompany,onDutyTime,outDutyTime,isDimission,birthday FROM ( SELECT * FROM Hrm_HrmData WHERE (isDimission = 79 AND onDutyTime < date_add(‘2020-01-01‘, interval 1 MONTH)) OR (isDimission = 80 AND outDutyTime >= date_add(‘2020-01-01‘, interval 1 MONTH)) ) h WHERE h.employeeCode not in ( SELECT employeeCode FROM DataAnalysis_HrmDataHistory )
not exists优化 mysql数据存在不插入
标签:modifier sts rom com mon 代码 art stat div