Get status changes

Does anybody knows how to list values when it is different from the previous value?

for example, if I have

time | Value
1 State1
2 State1
3 State1
4 State1
5 State1
6 State2
7 State2
8 State2
9 State2
10 State3
11 State2
12 State2
13 State2
14 State1
15 State1
16 State1
17 State1
18 State1

I want it to return:

time | Value
1 State1
6 State2
10 State3
11 State2
14 State1

No one? Is this even possible in InfluxDB?