I have a problem in a table that has duplicate data. The duplicate data is identified by an ID, where each line has the identifier and a date, how can I delete all the data with more than 1 record from the table, leave only the most recent record?
The database is an MS SQL SERVER, that is, the script should cause you to delete the 4 oldest lines in the list below:
ID DATA
17081618585 | 18.02.02 18:42:41
17081618585 | 18.02.02 19:30:41
17081618585 | 18.02.02 20:42:41
17081618585 | 18.02.02 20:42:41
17081618585 | 18.02.02 22:42:42