title: inserting query result to a table
body: <p>i have here</p>
  
  <pre><code> table_A
  | Customer ID | moneyspent |
      001             50
      002             30
      003             20
      003             20
      002             30
  </code></pre>
  
  <p>i have seen a query that gets the sum of all moneyspent from table A</p>
  
  <p><code>SELECT SUM(moneyspent) FROM table_A</code></p>
  
  <p>but i want the results to be inserted in table B's column"totalspent" like this</p>
  
  <pre><code> table_B
  | Customer ID | totalspent |
     001           50
     002           60
     003           40
  </code></pre>
  
  <p>help pls.
  thanks</p>