I have several versions assigned to a DocumentID.
DocID Version
ABC 1
ABC 2
ABC 3
DEF 1
DEF 2
How can I delete the older versions and only keep the most recent? After the delete, this should remain in the table:
DocID Version
ABC 3
DEF 2
SQL Server 2005+:
For SQL Server 2000 it’s a little more complex. (It’s always useful to include version information.)
Apparently this latter query will work in MySQL as well (thanks @bluefeet).
For MySQL you’re on your own, you may be better off posting a completely different question.