Select on value change
问题 I have a table that looks like this in a MySQL database: CREATE TABLE IF NOT EXISTS Example(Batch_Num int, Time DATETIME); INSERT INTO Example VALUES (1,'2020-12-04 05:06:12'), (1,'2020-12-04 05:06:13'), (1,'2020-12-04 05:06:14'), (2,'2020-12-04 05:06:20'), (2,'2020-12-04 05:07:12'), (2,'2020-12-04 05:07:20'), (1,'2020-12-04 05:07:25'), (1,'2020-12-04 05:07:35'), (3,'2020-12-04 05:07:35'); I would like to select all lines where the Batch_Num is different from the previous value including the