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.
Amm I think I got it on my own :)