SELECT DATE_FORMAT( DATE_ADD( DATE_SUB(NOW(), INTERVAL 1 DAY), INTERVAL xc - 1 HOUR ), '%Y-%m-%d %H' )AS HOUR
FROM
( SELECT @xi :=@xi + 1 AS xc FROM
( SELECT 1 UNION SELECT 2 UNION SELECT 3 )xc1,
( SELECT 1 UNION SELECT 2 UNION SELECT 3 )xc2,
( SELECT 1 UNION SELECT 2 UNION SELECT 3 )xc3,
(SELECT @xi := 0)xc0
)xcxc
sql查询过去24小时的时间信息
最新推荐文章于 2024-01-22 17:06:10 发布