title: Sum the “previous row” value with existing row value in a SELECT statement
body: <p>I want to sum the previous value with the existing value in that row.</p>
  <p>Here's my code:</p>
  <pre><code>SELECT
      co.partner_id,
      to_char(co.date, 'DD') AS day,
      to_char(co.date, 'MM') AS month,
      to_char(co.date, 'YYYY') AS year,
      sum(col.qty * p.price) AS priceday
  FROM
      order_detail col
      JOIN
  ORDER co ON co.id = col.order_id
  JOIN product p ON p.id = col.product_id
  GROUP BY
      co.partner_id,
      to_char(co.date, 'MM'),
      to_char(co.date, 'YYYY'),
      to_char(co.date, 'DD')
  </code></pre>
  <p>that code become like this:<a href="https://i.stack.imgur.com/CtzWx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CtzWx.png" alt="IMAGE TABLE" /></a></p>
  <p>the table sould be like this :
  <a href="https://i.stack.imgur.com/Sak7s.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Sak7s.png" alt="IMAGES" /></a></p>
  <p>Thank You.</p>