Skip to Main Content
  • Questions
  • How to remove duplicate rows without using column names in the query.

Breadcrumb

XMAS_TREE

The AskTOM team is taking a break over the holiday season, so we're not taking questions or responding to comments, but we might still sneak in a few Office Hours sessions! Thanks for being a member of the AskTOM community.

Question and Answer

Connor McDonald

Thanks for the question, ARINDAM.

Asked: August 06, 2017 - 7:35 am UTC

Last updated: August 06, 2017 - 6:12 pm UTC

Version: 10G/11G

Viewed 1000+ times

You Asked

Hello,
Please help me out regarding the following sql query.
Let's consider I have a table of 100 colums with no primary key,where some rows are entirely duplicate.What will be the delete statement to remove the duplicate rows?Delete statements I found in internet,all uses column names,but mentioning 100 column names in delete statement does't make sense.

Thanks In advance.

and Connor said...

You *have* to use column name(s) because that is how you are DEFINING a duplicate.

You just said so yourself:

"where some rows are entirely duplicate"

How did you define duplicate ? You used the "entirely" ? That *IS* the columns - in your case, all of them.

Here's a video on how to do it



We're not taking comments currently, so please try again later if you want to add a comment.

More to Explore

SQL

The Oracle documentation contains a complete SQL reference.