I have this SQL statement to find duplicate rows in a table....
SQL Code:
select A, B, count(*) as count
FROM table
group by A, B
having count>1
The table being queried also has an int field named Version which is unique for the grouped records.
Can some please show me how to take those results and remove the duplicate the has the lowest version?
For example if the result is
A|B|count
a|b|2
then there are 2 records that could look like this
A|B|version
a|b|1
a|b|2
I need to remove the record where version = 1
Thanks for looking
Kevin