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

How does a rank transform differ from aggregator transform functions max and min?

0 Answers  


What is a Shortcut and What is the difference between a Shortcut and a Reusable Transformation?

1 Answers  


when do we use static cache and when do we use dynamic cache in lookup transformation? with example.

1 Answers  


how to design mapping half of source table records into one target and remaining half into another target

8 Answers   ABC,


Hello Everyone,i have one question on sequence generator.i have two targets and the records comes from the source will place in the targets like 1-10 rec in target1 and 11-20 rec in target2,21-30 rec in target1...etc so any one can help me? plz..Thanq in adv.

7 Answers   Cognizant, Wipro,






Plz can anybody send Informatica and Cognos FAQ Plz To thid ID ppradeep_dwh@ayhoo.co.in

2 Answers  


What if the source is a flat-file? Then how can we remove the duplicates from flat file source?

1 Answers  


Explain incremental aggregation in informatica

0 Answers   Informatica,


what is datamart

4 Answers   IBM, Informatica,


tell me the rules and responsblites in our project(my project is development)

0 Answers  


What are the types of groups in Router transformation?

1 Answers   Informatica,


What are the informatica performance improvement tips

0 Answers   Informatica,


Categories