Hello everyone,
I'm trying to come up with a query that removes rows where a certain column has the same value (for instance, the column's value is the same in rows #503, #677 and #1020).
There are two catches:
- I can't specify the value (or values) to be checked for repetition, the query has to check for any repeated value;
- I can't also specify the number of repetitions, the minimum is 2 but there's no maximum.
I want to remove all repeated rows, except for the first one.
Also, it can't be just a View, I have to actually remove these rows from the table.
I've been thinking, but can't come up with anything. "SQL DISTINCT *" doesn't help because I have to look for repetitions only in this specific column. Perhaps some way of using "SQL DISTINCT [ColumnName]", but I've been unable to form the whole query.
I've also googled about this, but none of the results helped me (either they involved 2 columns, used Distinct in a way that doesn't help my case, used Views or involved 2 tables).
All help is appreciated. Thanks in advance!