title: Auto-increment field that resets after a change in another field
body: <p>Can you provide a very simple SQL example of how to create a "count" or "order" field that would auto-increment, but restart after every change in a different field? In the table below, the "Order" field would restart at "1" every time there was a change in the "Meal" field. Thanks.</p>
  
  <p>Meal&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Time&nbsp;&nbsp;&nbsp;&nbsp;Order<br/>
  Lunch&nbsp;&nbsp;&nbsp;&nbsp;10:30&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1<br/>
  Lunch&nbsp;&nbsp;&nbsp;&nbsp;11:00&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2<br/>
  Lunch&nbsp;&nbsp;&nbsp;&nbsp;11:15&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3<br/>
  Dinner&nbsp;&nbsp;&nbsp;&nbsp;4:30&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1<br/>
  Dinner&nbsp;&nbsp;&nbsp;&nbsp;4:45&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2<br/>
  Dinner&nbsp;&nbsp;&nbsp;&nbsp;5:00&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3<br/>
  Dinner&nbsp;&nbsp;&nbsp;&nbsp;5:30&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4<br/></p>