In MySQL, how to group similar successive records that they are not separated by other deferent records

```
id | type |
1  | 1    |
2  | 1    |
3  | 1    |
4  | 5    |
5  | 1    |
6  | 8    |
7  | 1    |
8  | 3    |
9  | 3    |
10 | 3    |

```

the result should be like this :

```
id | type |
3  | 1    |
4  | 5    |
5  | 1    |
6  | 8    |
8  | 1    |
10 | 3    |

```