select
time
from
(SELECT
DATE_FORMAT( DATE_SUB( DATE_FORMAT( date_sub(curdate(), interval 1 day),'%Y-%m-%d'),
INTERVAL ( -(@i:=@i+1) ) HOUR ) ,'%Y-%m-%d %H') AS 'time'
FROM (
SELECT a FROM
(SELECT '1' AS a UNION SELECT '2' UNION SELECT '3' UNION SELECT '4' ) AS a
JOIN
( SELECT '1' UNION SELECT '2' UNION SELECT '3' UNION SELECT '4' UNION SELECT '5'
UNION SELECT '6'
) AS b
ON 1
) AS b ,(SELECT @i:=-1) AS i
)tab1
union all
select
time
from
(SELECT
DATE_FORMAT( DATE_SUB( DATE_FORMAT( date_sub(curdate(), interval 2 day),'%Y-%m-%d'),
INTERVAL ( -(@j:=@j+1) ) HOUR ) ,'%Y-%m-%d %H') AS 'time'
FROM (
SELECT a FROM
(SELECT '1' AS a UNION SELECT '2' UNION SELECT '3' UNION SELECT '4' ) AS a
JOIN
( SELECT '1' UNION SELECT '2' UNION SELECT '3' UNION SELECT '4' UNION SELECT '5'
UNION SELECT '6'
) AS b
ON 1
) AS b ,(SELECT @j:=-1) AS j
)tab2
union all
select
time
from
(SELECT
DATE_FORMAT( DATE_SUB( DATE_FORMAT( date_sub(curdate(), interval 3 day),'%Y-%m-%d'),
INTERVAL ( -(@k:=@k+1) ) HOUR ) ,'%Y-%m-%d %H') AS 'time'
FROM (
SELECT a FROM
(SELECT '1' AS a UNION SELECT '2' UNION SELECT '3' UNION SELECT '4' ) AS a
JOIN
( SELECT '1' UNION SELECT '2' UNION SELECT '3' UNION SELECT '4' UNION SELECT '5'
UNION SELECT '6'
) AS b
ON 1
) AS b ,(SELECT @k:=-1) AS k
)tab3
union all
select
time
from
(SELECT
DATE_FORMAT( DATE_SUB( DATE_FORMAT( date_sub(curdate(), interval 4 day),'%Y-%m-%d'),
INTERVAL ( -(@l:=@l+1) ) HOUR ) ,'%Y-%m-%d %H') AS 'time'
FROM (
SELECT a FROM
(SELECT '1' AS a UNION SELECT '2' UNION SELECT '3' UNION SELECT '4' ) AS a
JOIN
( SELECT '1' UNION SELECT '2' UNION SELECT '3' UNION SELECT '4' UNION SELECT '5'
UNION SELECT '6'
) AS b
ON 1
) AS b ,(SELECT @l:=-1) AS l
)tab4
union all
select
time
from
(SELECT
DATE_FORMAT( DATE_SUB( DATE_FORMAT( date_sub(curdate(), interval 5 day),'%Y-%m-%d'),
INTERVAL ( -(@m:=@m+1) ) HOUR ) ,'%Y-%m-%d %H') AS 'time'
FROM (
SELECT a FROM
(SELECT '1' AS a UNION SELECT '2' UNION SELECT '3' UNION SELECT '4' ) AS a
JOIN
( SELECT '1' UNION SELECT '2' UNION SELECT '3' UNION SELECT '4' UNION SELECT '5'
UNION SELECT '6'
) AS b
ON 1
) AS b ,(SELECT @m:=-1) AS m
)tab5
union all
select
time
from
(SELECT
DATE_FORMAT( DATE_SUB( DATE_FORMAT( date_sub(curdate(), interval 6 day),'%Y-%m-%d'),
INTERVAL ( -(@n:=@n+1) ) HOUR ) ,'%Y-%m-%d %H') AS 'time'
FROM (
SELECT a FROM
(SELECT '1' AS a UNION SELECT '2' UNION SELECT '3' UNION SELECT '4' ) AS a
JOIN
( SELECT '1' UNION SELECT '2' UNION SELECT '3' UNION SELECT '4' UNION SELECT '5'
UNION SELECT '6'
) AS b
ON 1
) AS b ,(SELECT @n:=-1) AS n
)tab6
union all
select
time
from
(SELECT
DATE_FORMAT( DATE_SUB( DATE_FORMAT( date_sub(curdate(), interval 7 day),'%Y-%m-%d'),
INTERVAL ( -(@o:=@o+1) ) HOUR ) ,'%Y-%m-%d %H') AS 'time'
FROM (
SELECT a FROM
(SELECT '1' AS a UNION SELECT '2' UNION SELECT '3' UNION SELECT '4' ) AS a
JOIN
( SELECT '1' UNION SELECT '2' UNION SELECT '3' UNION SELECT '4' UNION SELECT '5'
UNION SELECT '6'
) AS b
ON 1
) AS b ,(SELECT @o:=-1) AS o
)tab7