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

Breadcrumb

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



Is this answer out of date? If it is, please let us know via a Comment

More to Explore

SQL

The Oracle documentation contains a complete SQL reference.