How to display all the duplicate records from the oracle
Table?

Answer Posted / prasad

select * from Table_name where column_name in(select Column_name from table_name group by column_name having count(1)>1)


select deptno from emp where deptno in (select deptno from emp group by deptno having count(1)>1)

u will get only duplicate records

for Example:

deptno
----------
10
10
20
20
30
40
50

by using above query the o/p displays

deptno
--------------
10
10
20
20

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to get sum of sal based on dept_no and then sum of all sal irrespective of dept_no in same sql. output:- 10, 200(sum of sal for dept_no 10), 5000(sum of all sal)

721


I have a few records just I want to store data in to targets cycling way how?

2140


Can anyone tell me a difficult situation who have handled while creating Datastage jobs?

3046


How do y read Sequential file from job control?

15107


Explaine the implimentation of scd's in ds indetail, please send me step by step procedure to perform scd's 1,2,3. Please replay for this, Thanks in advance

1980


What is difference between server jobs & parallel jobs?

823


Enlist various types of routines in datastage.

900


If you want to use the same piece of code in different jobs, how will you achieve it?

901


What is a merge in datastage?

977


Does datastage support slowly changing dimensions ?

858


How a source file is populated?

841


Name the different types of Lookups in Datastage?

1002


Differentiate between data file and descriptor file?

817


What are the enhancements made in datastage 7.5 compare with 7.0?

934


Differentiate between datastage and datastage tx?

840