title: Calculation involving repeated items in MySQL table
body: <p>I have a table with a composite primary key on EID (event ID) and start_time. I have another column called attending.</p>
  
  <p>Users make their events more popular by reusing the event ID and changing the date, however, I create a new line in the database in this instance.</p>
  
  <p>I would like to create a 4th column, actual_attending which is equal to the attending value minus the previous event's attending value. If their is no previous ID, the column can be null. How can I calculate this via update.</p>
  
  <p>Here is a sqlfiddle as an example: <a href="http://sqlfiddle.com/#!2/43f2c5" rel="nofollow">http://sqlfiddle.com/#!2/43f2c5</a></p>