Skip to content
Advertisement

Sum where values are equal between rows in certain columns in Oracle

With a query like the following:

That returns data like the following:

How can I add a column with the sum of the column QTY where the columns CODE1, CODE2 and CODE3 are the same between rows?

Something like the following:

Advertisement

Answer

You can use window functions:

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement