how do u fnd the duplicate rows and how to delete the
duplicate rows?

Answers were Sorted based on User's Feedback



how do u fnd the duplicate rows and how to delete the duplicate rows?..

Answer / suraj kedia

Hi Sankar...
The methods as told by u r correct but i guess sree has
asked about finding duplicate records and the way to delete
them in oracle not in informatica.

So, the query to find out the duplicate records in a given
table (e.g. emp table) is as below:

select * from emp where empno in (select empno from emp
group by empno where count(*) >1);

Explanation:
============
See, in EMP table there are total 14 records out of which
only empno is unique,rest all fields can be repeated, so the
empno which are repeated more than once are duplicate
records & the above query shows the same.

Query to delete duplicate records;

delete from emp where rowid not in (select max(rowid) from
emp group by empno);

OR

delete from emp where rowid not in (select min(rowid) from
emp group by empno);

OR

delete from emp e1 where rowid < (select max(rowid) from emp
e2 where e1.empno=e2.empno);

OR

delete from emp e1 where rowid > (select min(rowid) from emp
e2 where e1.empno=e2.empno);

Is This Answer Correct ?    21 Yes 3 No

how do u fnd the duplicate rows and how to delete the duplicate rows?..

Answer / sankar

repet(more then one time) the rows is duplicate rows,
there r many ways to dele the duplicate rows
1.in source qualifies t/r select the DISTINC option
2.in aggreter t/r select the group by port
3.in sorter t/r select the distinc

Is This Answer Correct ?    5 Yes 4 No

Post New Answer

More Informatica Interview Questions

i have two sources two flatfiles same structure one flatfile contain 100 million recs another flatfile contain 10 million recs i have to connect single target(performance oriented answer) what are the steps we have to do this scenario

4 Answers   Polaris,


How to load a relational source into file taget?

2 Answers  


what is semi-additive fact?where did u used?

2 Answers  


I HAVE 10 records in source. I want to store i record in target 1, second record in target 2, third record in target 3, 4 th record again in target 11, 5th again in target 2, 6th again in target3 etc.... how it is possible?

5 Answers   Syntel,


write a query following table bookid language 1234 english 1234 french 1234 spanish 1235 english i want the output are bookid lang1 lang2 lang3 1234 english french spanish 1235 english null null

1 Answers   TCS,






By using Transformation i need top most 5 employee salary from each deptwise? Deptno 10,20,30? which transformation we need to use?

8 Answers  


What is galaxy shema

2 Answers   CGI,


How to Create a folder using pmrep command?

0 Answers  


How do you take care of security using a repository manager

2 Answers  


What is the exact difference b/w IN and EXIST in Oracle..?

4 Answers   Wipro,


my source like dis 10,asd,2000 10,asd,2000 10,asd,2000 20,dsf,3000 20,dsf,3000 20,dsf,3000 like dis and my requirement is first record is inserted into first target and duplicates of first record is inserted into second target ...like dis way ...? how to achieve dis?

4 Answers   Mind Tree, Polaris,


What is session task and command task?

0 Answers  


Categories