mysql 5.7, query to achieve this:
Get least ID if repeating by message in sequence, order by ID.
INPUT:
id message
2485132 Process started
2485118 Process completed
2483660 Process started
2482165 Process started
2480689 Process started
2480686 Process completed
2479225 Process started
OUTPUT:
id message
2485132 Process started
2485118 Process completed
2480689 Process started
2480686 Process completed
2479225 Process started
2
Answers
As I understand your question, you want to bring the "first" record in each group of consecutive rows having the same message.
Here is one way to solve it in MySQL 5.x with a correlated subquery:
Basically, the subquery returns the status on the "previsous" row; if it is different from the status on the current row, then we retain the row, else we discard it.
fiddle