skip to main | skip to sidebar

Oracle Juggernath

Monday, February 6, 2012

How to delete duplicate rows in a table in oracle?

Here is the query for the same.

DELETE FROM
table_name A
WHERE
a.rowid >
(
SELECT
min(B.rowid)
FROM
table_name B
WHERE
A.col1 = B.col1
AND
A.col2 = B.col2
);
Posted by Seshagiri Dama at 2:58 AM
Labels: delete duplicate rows

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

About Me

Seshagiri Dama
I have been working as PL/SQL developer since 2005. I am passionate about oracle performance tuning. I am Oacle 10g DBA certified associate.
View my complete profile

Blog Archive

  • ▼  2012 (19)
    • ►  September (1)
    • ►  August (4)
    • ▼  February (14)
      • How to trim spaces without using trim function in ...
      • What is the difference between case and decode in ...
      • what is the syntax of crontab file?
      • Give me the situation where truncate is not allowe...
      • What is the difference between procedure and package?
      • can a cursor be overloaded?
      • How to delete duplicate rows in a table in oracle?
      • what is the difference between nested query and co...
      • How to do incremental data load from one table to ...
      • How to do string aggregation in oracle?
      • How to find nth highest salary in oracle?
      • How to find week number for a given date in oracle?
      • What is the difference between datapump and old im...
      • How to add two dates in oracle?
  • ►  2011 (8)
    • ►  September (4)
    • ►  August (4)
  • ►  2009 (6)
    • ►  June (3)
    • ►  May (3)