Explaining the title:
I have a table called projects, these projects can be approved or disapproved.
Each insertion or update of a record in the project table is stored in a history table (eg I saved a project and then updated 2 times / In the history table we will have 3 tuples).
Normally these are approved and disapproved several times, and very rarely after approval can be disapproved again.
My goal is to make a query that shows only the ID's that have the last registration date with the disapproved situation.
That is, if I have a project that has been disapproved, failed, and disapproved.
It should appear in the query.
If it was disapproved, approved, and disapproved.
It should also appear in the query.