Skip to content
Advertisement

Grouping a column in oracle

I have three columns within my table: Amount, OrderNumber, Customerid

For each customerid there will be ordernumber and amount. Now i need to display customerid,Ordernumber and Amount(total Amount- for each customerid).

Expected:

Advertisement

Answer

Use sum() over (partition by ..) analytic function to sum up the amount per each row :

Demo

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