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

What will be the approach?

0 Answers  


What is informatica?

0 Answers  


can we use union transformation in joiner transformation?how?

1 Answers   Dabur, Tech Mahindra,


Difference between Target-based loading and constraint-based loading?

0 Answers  


Data transformed successfully from Source table to target table. Now how you will ensure that the data in Target table is proper. I answered will verify one or two records and check Then question was that the Development is doing (1-2 record verification)but as a tester you have to verify the complete data, how you will do?? Please answer

2 Answers  






What are the advantages of using informatica as an etl tool over teradata?

0 Answers  


what is the dashbords?

1 Answers   IBM,


How to merge First Name & Last Name?

8 Answers  


What are the modules in Power Center

0 Answers  


Examples of Fatal & Non-Fatal error?

2 Answers   Cap Gemini,


How to load only the first and last record of a flat file into the target?

3 Answers   Mind Tree,


Did u used latest transformations of 8.6.0? for what?

0 Answers  


Categories