title: SQL Update Query to update a table with aggregate value from another table using multiple fields
body: <p>I have table A which contains distinct Name, Dept, State Worked, and an empty field called earnings.  I have a second table which has many rows where the Name, Dept, and State Worked match table A and an earnings field.  I'd like to run an update query that will total the earnings for the distinct Name, Dept, State Worked records and place that value in earnings field in table A.</p>
  
  <p>Table A:<br>
  Alan, Sales, CO<br>
  Alan, Sales, CA<br>
  Paul, Development, CO<br>
  Paul, Development, CA  </p>
  
  <p>Table B:<br>
  Alan, Sales, CO, $100<br>
  Alan, Sales, CO, $150<br>
  Alan, Sales, CA, $200<br>
  Paul, Development, CO, $100<br>
  Paul, Development, CA, $200<br>
  Paul, Development, CA, $300  </p>
  
  <p>Desired Result (Table A):<br>
  Alan, Sales, CO, $250<br>
  Alan, Sales, CA, $200<br>
  Paul, Development, CO, $100<br>
  Paul, Development, CA, $500  </p>