find groups by event timestamps that are out of order

15 Views Asked by At

The table records events. Each event has multiple actions. Each action has a timestamp.

Event_ID Action Action_Timestamp
001 Create Rocket 23:00:00
001 Load Rocket 23:00:01
001 Launch Rocket 23:00:03
002 Create Rocket 10:00:05
002 Launch Rocket 10:00:03

In this example, I want to find the Event_ID 002, because its "Launch Rocket" action has a timestamp that is earlier than the timestamp of the "Create Rocket" action.

Additionally:

  • I do not know the total number of actions for each event, which varies from event to event.
  • I know that the first action should always be "Create Rocket." If, for any event, an action that is not "Create Rocket" has the earliest timestamp within that event, then that is an "out of order" event, and I want to find it.
0

There are 0 best solutions below