I've a simple but large table in an SQL database which has four fields (id(int PK), time (unix timestamp, not null), value (double, not null) and an ID_fk (integer foreign key).
Data is recorded every minute, but at a seemingly random second for subsets of sensors, each sensor has a foreign key value though.
My question is this, I need to write a query that will tell me when, over all two minute intervals in the dataset, a series of sensors have a value greater than 0.9.
I was thinking for trying to create a temporary table and do it that way, simplifying the time by only storing it at minute resolution?
Any advice would be greatly received, Thanks, James