--备份
SELECT * into T_PM_ORGRANGE_bak1110 FROM T_PM_ORGRANGE
--检查是否备份成功
select count(1) from T_PM_ORGRANGE_bak1110
--查询是否有重复脏数据
SELECT FORGID,FUSERID,FTYPE FROM T_PM_ORGRANGE group by FORGID,FUSERID,FTYPE having count(1)>1
--删除脏数据
DELETE FROM T_PM_ORGRANGE WHERE fid not in (SELECT max(Fid) FROM T_PM_ORGRANGE group by FORGID,FUSERID,FTYPE having count(1)>1) and fid in (SELECT t1.fid FROM T_PM_ORGRANGE t1
inner join (SELECT FORGID,FUSERID,FTYPE FROM T_PM_ORGRANGE group by FORGID,FUSERID,FTYPE having count(1)>1) t2
on t1.FORGID=t2.FORGID
and t1.FUSERID = t2.FUSERID
and t1.FTYPE = t2.FTYPE)
EAS 去除重复的 职位 组织树信息
原创
©著作权归作者所有:来自51CTO博客作者晴天MZ的原创作品,请联系作者获取转载授权,否则将追究法律责任
下一篇:记账中心二开
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
组织架构树 组织架构树 java
组织架构树 组织架构树 java
组织架构树 List 树形结构 递归