1 Reply Latest reply on Jul 23, 2014 8:03 PM by thatJeffSmith-Oracle

    how to get the sum of every 3 rows in a table.

    KNPriya

      there is a sales table in which sales_id(unique), price(number) are the columns. how to write a sql query to get the sum of price of every three rows

      for ex:  sales_id,      price

                          1             1000

                          2              2000

                          3               1500

                          4                2000

                          5               2500

                          6               3000 

       

      I want the output as   ex:  sum_of_3rows

                                                   4500

                                                   7500