How to retrieve the data which are only duplicates .... (ie, if have in "prasad" in the "ename" COLUMN four times, I have to retrieve only the prasad for 4 times as my output)
[b]Question asked by visitor prasad[/b]
Printable View
How to retrieve the data which are only duplicates .... (ie, if have in "prasad" in the "ename" COLUMN four times, I have to retrieve only the prasad for 4 times as my output)
[b]Question asked by visitor prasad[/b]
[QUOTE=;][/QUOTE]
select ename from Emp
group by ename where rownum<=4;
select * from table_nm where column_nm in(select col_name from table_name group by col_nm having count(1)>1);
for example:-
select * from emp where job_id in (select job_id from emp group by job_id having count(1) > 1);
select ename from emp
having count(ename)>1
group by ename