I have a table with 2 columns. UTCTime and Values. The UTCTime is in 15 mins increment. I want a query that would compare the value to the previous value in one hour span and di
select SUBSTRING_INDEX(UTCTime,':',1) as time,value, count(*)-1 as total from foo group by value,time having total >= 1;
fiddle