how do u fnd the duplicate rows and how to delete the
duplicate rows?
Answer Posted / 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 |
Post New Answer View All Answers
How do you set a varible in incremental aggregation
What is a repository manager?
Explain what are the different types of transformation available in informatica.
What is the cumulative sum and moving sum?
without table how to come first record only in oracle?
can you please explain me pre session and post session options?
What are the main issues while working with flat files as source and as targets ?
What are the popular informatica products?
Define pmcmd command?
What is difference between a gateway node and worker node?
Explain sessions. Explain how batches are used to combine executions?
What is confirmed fact in dataware housing?
What is sq transformation?
How do you manage the Parameter files while migrating your data from one environment to another environment?
How to convert a row into column and a column into rows? Name all DTM threads. What all threads stop when we issue STOP or ABORT? How to pass the value of a data(variable kind of) from one session ( generated in mapping) to another session in the same workflow... What are the tyoes of partitioning you know and how to apply them in real time ... Can partitioning be applied to expression transformation and how