Running Total by Group SQL (Oracle)
I have a table in an Oracle db that has the following fields of interest: Location, Product, Date, Amount. I would like to write a query that would get a running total of amount by Location, Product, and Date. I put an example table below of what I would like the results to be. I can get a running total but I can't get it to reset when I reach a new Location/Product. This is the code I have thus far, any help would be much appreciated, I have a feeling this is a simple fix. select a.*, sum(Amount) over (order by Location, Product, Date) as Running_Amt from Example_Table a +----------+---------