您可以尝试此方法将时间转换为日期和小时格式-
select to_varchar(time, 'YYYY-MM-DD'), hour(time), sum(r_time) as r_time, sum(p_time) as p_time from t1 group by date(time), hour(time) order by to_varchar(time, 'YYYY-MM-DD'), hour(time);
您也可以尝试将Series_Round()与group by子句一起使用。
select SERIES_ROUND(time, 'INTERVAL 1 HOUR') as time, sum(r_time) as r_time, sum(p_time) as p_time from t1 group by SERIES_ROUND(time, 'INTERVAL 1 HOUR') order by SERIES_ROUND(time, 'INTERVAL 1 HOUR');