Home > database >  MySQL how to realize the sliding window?
MySQL how to realize the sliding window?

Time:11-16


As shown in figure, could you tell me how can output the sliding time window for 10 min warning data, namely the 2016-3-25 00:00-2016-3-25 00:10; The 2016-3-25 00:01onsaturday (UK time) - 2016-3-25 00:11, and so on data? I am now a an implementation, the code is as follows:
SELECT
DATE_FORMAT (time ` ` alarm occurs, '% % Y - M - H: % D % % I ") AS time ` ` alarm occurs, uawo. ` warning title `
The FROM
` u - allwifi - ordered ` AS uawo
WHERE
` alarm time `
BETWEEN
'the 2016-3-25 00:00'
AND
'the 2016-3-25 00:10';

But such a manually entered a too much trouble, have a program that can let time automatically increase?
Have a great god can help me
  • Related