title: Mysql Updating a record with a value from the previous record
body: <p><p>I have the following table, and what I'm trying to do is to update, for example, RefIDs 3-14 with the same Status value "Added" as the previous value.  I want to do this until it reaches the next completed value.  So when it encounters "Added", it updates all rows below that have a null with "Added" until it reaches the next RefID that has a populated Status, and subsequently updates the next batch of values.  Can this be done?  Any help would be greatly appreciated. I'm looking for this to be dynamic, as I don't want to manually update, say, Status = "Added" where RefID is 3.<p></p>
  
  <p><code>RefID        Status<br>
  <ul>1               Null</ul><br>
  <ul>2               Added</ul><br>
  <ul>3               Null</ul><br>
  <ul>4               Null</ul><br>
  <ul>5               Changed</ul><br>
  <ul>6               Null</ul><br>
  <ul>7               Null</ul></code></p>
  
  <p><p>What I want to achieve is this:</p><br></p>
  
  <p><code>RefID           Status<br>
  <ul>1               Null</ul><br>
  <ul>2               Added</ul><br>
  <ul>3               Added</ul><br>
  <ul>4               Added</ul><br>
  <ul>5               Changed</ul><br>
  <ul>6               Changed</ul><br>
  <ul>7               Changed</ul></code></p>