我有下表,需要输出
ID Data From To
1 aa 2015-01-01 2015-01-05
1 aa 2015-01-05 2015-01-09
1 aa 2015-01-09 2015-01-15
1 bb 2015-01-15 2015-01-20
1 aa 2015-01-01 2015-01-05
1 aa 2015-01-05 2015-01-11
2 aa 2015-01-06 2015-01-10
预期输出
1 a 2015-01-01 2015-01-15
1 b 2015-01-15 2015-01-20
1 a 2015-01-01 2015-01-11
2 a 2015-01-06 2015-01-10
感谢。