Oracle11G SQL查询出数据中重复的记录

Oracle 01/11 阅读 41 views次 人气 0
摘要:

Oracle11G SQL查询出数据中重复的记录,根据IP字段分组,统计出IP字段的内容以及IP字段重复的个数。

1、查询重复的系统资源

select * from (

    select count(r.resip) as num,r.resip from (

        select ast.* from AST_ASSET ast  inner join E_SysResource sysr on ast.resuuid = sysr.resuuid and ast.deleted='0'

    ) r group by r.resip 

) t where t.num > 1


2、查询重复的应用资源

select * from (

    select count(r.resip) as num,r.resip from (

        select ast.* from AST_ASSET ast  inner join E_AppResource appr on ast.resuuid = appr.resuuid and ast.deleted='0'

    ) r group by r.resip 

) t where t.num > 1


评论

表情

分享到: