求一mysql分组sql语句

求一mysql语句
表结构如下:

表结构如下:
| id | tag | number |
| 0BB7 | x | 1 |
| 0BA7 | x | 2 |
| 0BE7 | f | 3 |
| 0BT7 | f | 4 |
| 0BQ7 | x| 5 |
| 0B21 | x | 6 |
| 0B22 | x | 7 |
| 0B23 | x | 8 |
| 0B24 | x | 10 |
| 0B25 | x | 11 |
| 0B26 | x | 13 |

number 列是唯一的不重复 要求得到
| tag | begin_ number | end_number |
| x | 1 | 2 |
| f | 3 | 4 |
| x | 5 | 8 |
|x | 10 | 13 |

题那里最后应该是
|x | 10 | 11 |
|x | 13 | 13 |吧?

number字段设置为主键

一部分数据,看不出啥,能说说你的想法吗?用文字表述下你想实现的结果

主要需求 就是 分段,比如1,2,3, 5,6, 7,9, 82 非连续无重复递增,将连续的分为一组,得到第一行数据为 begin_ number=1,end_number=3 ,第二行数据 begin_ number=5,end_number=7,第三行数据 begin_ number=9,end_number=9,第四行数据 begin_ number=82,end_number=82