--备份
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)
地区 & IP 库
yudao-spring-boot-starter-biz-ip (opens new window)业务组件,提供地区 & IP 库的封装。
#1. 地区
AreaUtils (opens new window)是地区工具类,可以查询中国的省、市、区县,也可以查询国外的国家。
它的数据来自 …