- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Using Group by hour in SAP HANA table
You can try this method to convert time to date and hour format −
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);
You can also try using Series_Round() with a group by clause.
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');
Advertisements
To Continue Learning Please Login
Login with Google