Skip to content
Advertisement

Tag: window

Complicated group by – windows

Can you please help with the following grouping: Name can have states that can be repeated several times and it is essential in output to have all the state changes over time and to have the starting date of the state Here is the input data: Desired output Answer Assuming you want to find the start date per consecutive sequence

Aggregation level is off (Postgresql)

I have Order data for 2 customers and their order. And I am trying to calculate what the sum for the price is for every customter for that specific order only for product N Table: This is my query: For some reason I do not understand it gives me several rows per same customer. I am trying to get only

Advertisement