title: How to add one column to another column on all rows in a table?
body: <p>Given a table like below. I want to move and add all values from the column escrow1 to balance1 of it's corresponding uid. And likesise for escrow2 to balance2. So in the case below. The row with uid 4 will have a balance of 1858000+42000, row with uid 3 will have a balance1 = 1859265+30735 and escrow1 = 0, and row with uid 2 will have a balance2 = 940050+1050000 and escrow2 = 0. Everything else is the same. Is it possible to do this in one query? I've been trying hard, but I can't come up with a solution, so I might have to do it in a function and loop all the rows, but I would prefer not to. Also I know that only a small amount of rows will have escrow values not equal to 0. Given that, is there a way to optimize the query? </p>
  
  <pre><code> uid | balance1 | escrow1 | balance2 | escrow2 
  -----+----------+---------+----------+---------
     1 |     5000 |       0 |        0 |       0
     9 |     5000 |       0 |        0 |       0
     6 |  1900000 |       0 |  1899960 |       0
     5 |  1900000 |       0 |  1900000 |       0
     7 |  1900000 |       0 |  1900000 |       0
     8 |  1900000 |       0 |  1900000 |       0
     4 |  1858000 |   42000 |  1900014 |       0
     2 |  1910000 |       0 |   940050 | 1050000
     3 |  1859265 |   30735 |  1895050 |       0
  </code></pre>