title: How to sum all columns value of a table and display the total in new row by using Postgresql
body: <p>I am using normal select query to display all rows</p>
  
  <pre><code>SELECT 
      type,
      debit,
      credit,
      (debit-credit) as balance
  from bank_cash_registers
  </code></pre>
  
  <p>Its displayed like below image
  <a href="https://i.stack.imgur.com/nke4C.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nke4C.png" alt="enter image description here"></a></p>
  
  <p>Now I need to display this total as an additional row with help of Postgresql query like below image. How can I achieve this?</p>
  
  <p><a href="https://i.stack.imgur.com/wdBHE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wdBHE.png" alt="enter image description here"></a></p>
  
  <p>and also is there any option for separate total based on type like below..
  <a href="https://i.stack.imgur.com/TTCEq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TTCEq.png" alt="enter image description here"></a></p>