Duplicated data using system.tag.queryTagHistory

I have a boolean read every minute and DB “on Change”. The value anyway will be written every 5 minute if it wasn’t changed.
Using the function system.tag.queryTagHistory I would like have a list of records only when the data had changed.
Example :
minute data
1 0
6 0
11 0
13 1
18 1
19 0
24 0
29 0
31 1
34 1
36 0
41 0

I would like to obtain a list as follow :
1 0
13 1
19 0
31 1
36 0

Is it possible using parameters of that function or I have to implement a for loop to throw duplicated data?

Thanks