Running Total column by group

There are some SQL procedures that I have a very hard time visualizing. This is one of them.

Given these first five columns as the result of a ce_data table:

How would I add the RUNNING_TOTAL column as shown below? It is a running total of the OPERATION_DAYS column with the total reset grouped by BASE_ID, LOT_ID, SPLIT_ID.

Screenshot 2024-10-29 124706


SELECT ..., SUM(OPERATION_DAYS) 
    OVER(PARTITION BY BASE_ID, LOT_ID, SPLIT_ID 
    ORDER BY SEQUENCE_NO DESC) AS RUNNING_TOTAL
FROM ce_data
...
1 Like

That's perfect!

Thank you so much!