在 SAP HANA 表中使用根据小时分组
您可以尝试此方法将时间转换为日期和小时格式 −
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() 与分组子句一起使用。
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');
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
JavaScript
PHP