--■■■group byを使う方法■■■
select 氏名
from (select '0001' as 社員番号,'新井健二' as 氏名 from dual
union select '0002','鈴木太郎' from dual
union select '0003','佐藤宏' from dual
union select '0004','田中博' from dual
union select '0005','鈴木太郎' from dual)
group by 氏名
having count(*) > 1;
--■■■分析関数を使う方法■■■
select distinct 氏名
from (select 氏名,count(*) over(partition by 氏名) as 氏名count
from (select '0001' as 社員番号,'新井健二' as 氏名 from dual
union select '0002','鈴木太郎' from dual
union select '0003','佐藤宏' from dual
union select '0004','田中博' from dual
union select '0005','鈴木太郎' from dual))
where 氏名count > 1;