I have a table that includes versions of my table.
version_id transaction entity_id date
--------------------------------------------------------------
1 insert 1 11.11.2019 13:15:04
2 update 1 11.11.2019 13:16:04
3 insert 8 11.11.2019 13:17:04
4 update 1 11.11.2019 13:18:04
5 update 8 11.11.2019 13:19:04
6 update 1 11.11.2019 13:20:04
7 update 1 11.11.2019 13:21:04
8 delete 1 11.11.2019 13:22:04
For example entity id 1, I need 1,7,8 version numbers. 2,4,6 version numbers are not needed, so I can delete them. Actually I need last insert, update, delete transaction version numbers for an entity. The others will delete.
Can I remove all unnecessary update ids in this way?