I have a table 'userlogin' that has duplicates or tripiliates, even more for the 'loginid' field. And we need to clean it up and leave only the most recent.
There are two relevant fields:
The 'userloginid' is a consecutive number. (Autoid), the higher the number the most recent the entry
And the 'Loginid' field which is the one we need to check for duplicates.
I need an SQL that will delete any entries that are duplicates (or more) and leave only one of those entries, leaving the one where the 'userloginid' has the higher number (Most recent)
Any entries without duplicates should be left as is, we should not delete those. Only dup entries.
Any help is appreciated.