--■■■in述語を使用■■■
select hoge,fuga,hige,moe
from foo a
where (hoge,fuga,hige)
in (select b.hoge,b.fuga,b.hige from foo b
where b.RowID != a.RowID);
--■■■existsを使用1■■■
select hoge,fuga,hige,moe
from foo a
where exists(select b.hoge,b.fuga,b.hige from foo b
where b.RowID = a.RowID
intersect
select b.hoge,b.fuga,b.hige from foo b
where b.RowID != a.RowID);
--■■■existsを使用2■■■
select hoge,fuga,hige,moe
from foo a
where exists(select a.hoge,a.fuga,a.hige from dual
intersect
select b.hoge,b.fuga,b.hige from foo b
where b.RowID != a.RowID);
--■■■existsを使用3■■■
select hoge,fuga,hige,moe
from foo a
where exists(select 1 from foo b
where b.RowID != a.RowID
and b.hoge = a.hoge
and b.fuga = a.fuga
and b.hige = a.hige);
--■■■分析関数を使用■■■
select hoge,fuga,hige,moe
from (select hoge,fuga,hige,moe,
count(*) over(partition by hoge,fuga,hige) as 件数
from foo)
where 件数 >= 2;