title: Self-Join SQL statement w/calculated data
body: <p>I have a table with the following data:</p>
  
  <pre><code>id  date    name    schedulenum paymentamt
  1   12/2/2014   AB  077LR10 100
  2   12/2/2014   AN  077LR10 200
  3   12/2/2014   CD  077LR10 300
  4   3/10/2015   AN  083LR12 200
  5   3/10/2015   WC  083LR12 500
  6   5/20/2015   AB  105LR20 200
  7   5/20/2015   CD  105LR20 150
  8   5/20/2015   RH  105LR20 150
  9   5/20/2015   RG  105LR20 400
  </code></pre>
  
  <p>And I would like to write a query that would bring back the following results:</p>
  
  <pre><code>schedulenum paymentamt
  077LR10 600
  083LR12 700
  105LR20 900
  </code></pre>
  
  <p>Basically I need to create a SQL statement that selects data from <code>Table A</code> that will result in 2 columns.  The first column would be a unique schedule number (i.e., <code>'schedulenum'</code> - there are multiple rows with the same <code>schedulenum</code>) and a total payment amount (<code>'paymentamt'</code>) per <code>schedulenum</code> (each row will have a different <code>'paymentamt'</code>). I think this would require a self-join but not sure how to do it.</p>