select * from table group by jh,rq having count(1)>1
select * from ( select jh,rq,count(1)over(partition by jh,rq) cnt from table ) a where cnt>1;
select * from ( select jh,rq,row_number()over(partition by jh,rq order by rq) as cnt from t2 ) a where cnt>1;
select * from table1 a where exists (select 1 from table where jh = a.jh and rq = a.rq and rowid <> a.rowid)
select jh,rq,count(*) from table_name group by jh,rq having count(*) > 1;
用户的一个表因为疏忽没设主码,现在想查查这段时间有没有重复的数据.jh,rq两个字段应该是主码select jh,rq from tb group by jh,rq having count(*) > 1
select jh,rq from table where rowid!=( select max(rowid) from table t where table.jh=t.jh and table.rq=t.rq);
统计重复的select jh,rq count(*) from table group by jh,rq having count(1)>1 显示重复记录select by jh table a,(select jh,rq count(*) from table group by jh,rq having count(1)>1) b where b.jh=b.jh and a.rq=b.rg group by jh,rg
select jh,rq,count(1)over(partition by jh,rq) cnt from table
) a where cnt>1;
select * from (
select jh,rq,row_number()over(partition by jh,rq order by rq) as cnt from t2
) a where cnt>1;
select *
from table1 a
where exists (select 1 from table where jh = a.jh and rq = a.rq and rowid <> a.rowid)
select max(rowid) from table t
where table.jh=t.jh
and table.rq=t.rq);
显示重复记录select by jh table a,(select jh,rq count(*) from table group by jh,rq having count(1)>1) b where b.jh=b.jh and a.rq=b.rg group by jh,rg