Delete duplicates?
Hello!
I have a table with a column (nr) that miss a unique index and therefore also contains duplicates. (The table also have an identity column) I use the following question to identify which rows that are duplicates:
select count(nr) as Total, nr
from tTable
group by nr
having count(nr) > 1
The result might look like this
Total nr
3 1
What I would like to know is how I can delete all of the rows with nr = 1 but one row that I would like to keep in the table.
Thanks in advance!
Boson
|