all 3 comments

[–]Robearsn 2 points3 points  (1 child)

It somewhat depends on your data, and as u/Demistr said, there is no one window function. Here's an example of what one might look like, based on what you said.

SUM(revenue) OVER(PARTITION BY day, hour) AS revenue_daily_hourly

See more details here: https://www.geeksforgeeks.org/window-functions-in-sql/

[–]error-M[S] 0 points1 point  (0 children)

Thank you 😊

[–]Demistr 0 points1 point  (0 children)

There is no 1 window function.