Get events history from a table that holds events and their old versions at the same time
-
29-10-2019 - |
Question
I have a table with events "events" that holds all events and their older versions. I have these columns:
- "id" primary,
- "origin_id" here I keep the ID of the original event,
- "date_added" DATETIME column.
When I first add an event its "origin_id" get its "id" value. When I change this event I create a new event with the same "origin_id" as the first one, new auto-incremented "id" and new "date_added" of course.
How to get a list with all current events from table, without their old versions ordered by the starting date "start" - a DATETIME column again?
So if I have a 3 events and each of them has several revisions/updates I want to get only the last update for each of them.
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow