Question: Consider the following query using the tumbling window operator: Give an equivalent query using normal SQL constructs, without using the tumbling window operator. You can

Consider the following query using the tumbling window operator:
select item, System.Timestamp as window_end, sum(amount) from order timestamp by datetime groupGive an equivalent query using normal SQL constructs, without using the tumbling window operator. You can assume that the timestamp can be converted to an integer value that represents the number of seconds elapsed since (say) midnight, January 1, 1970, using the function to seconds(timestamp). You can also assume that the usual arithmetic functions are available, along with the function floor(a) which returns the largest integer ≤ a.

select item, System.Timestamp as window_end, sum(amount) from order timestamp by datetime group by itemid, tumblingwindow(hour, 1)

Step by Step Solution

3.43 Rating (169 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

An equivalent query using normal SQL constructs would be as follows select item datetime as windo... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Database System Concepts Questions!