I am struggling with the Vertica SQL Statement to delete all entries of an OrderID after a certain event had occurred.
This is a representation of my data.
**OrderID Activity**
1 Item Started
1 Task 1 complete
1 In storage
1 Deletion
1 Deletion Complete
2 Item Started
2 Deletion
2 Deletion Complete
In this scenario, I would like to delete the entries "Deletion" and "Deletion Complete" of the OrderID 1, since they occur after the activity "In storage". I want to keep all entries of OrderID 1 until (and including) "In Storage".
For OrderID 2 this is not the case, therefore I want to keep it.