I am using MySQL and facing a question. I want to count the consecutive occurrence of type based on each ID and select out only the IDs with more than 3 times of error-type.
Additionaly, based on the above result, I want to include the start timestamp and end timestamp in the result.
I’ve checked other posts but had no clues how to solve it.
Appreciate for any suggestions. Thank you in advance and welcome any advice.
The result I’d like to show is as the screenshot.
ID A: has 4 times consecutive errors, the start_at is the timestamp at the beginning of sequence
ID C: has 3 times consecutive errors, the start_at is the timestamp at the beginning of sequence
2
Answers
Thank you, p3consulting. It works and I will dive into the gap and island questions more. Here is what I've edited to get the result with dummy data.
Try