赞
踩
select DATE_FORMAT(date_add('2022-06-01 00:00:00', interval row DAY),'%Y-%m-%d') date from
(
SELECT @row := @row + 1 as row FROM
(select 0 union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) t,
(select 0 union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) t2,
(SELECT @row:=-1) r
) se
where date_add('2022-06-01 00:00:00', interval row DAY) <= '2022-06-31 23:59:59'
select DATE_FORMAT(date_add('2022-06-01 00:00:00', interval row HOUR),'%Y-%m-%d %H') date from
(
SELECT @row := @row + 1 as row FROM
(select 0 union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) t,
(select 0 union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) t2,
(SELECT @row:=-1) r
) se
where date_add('2022-06-01 00:00:00', interval row HOUR) <= '2022-06-01 23:59:59';
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。