title: Running query that restarts
body: <p>I am running a MySql database through phpmyadmin and am working on building a query to total some values.</p>
  
  <p>In EXCEL the formula looks like this =IF(AND(P6=P5,B6=B5),SUM(H5+F6),F6)</p>
  
  <p>That formula is put in the H column</p>
  
  <p>P Column is a class identifier.   B Column is their registration number.   H Column is their total points.   F column is the point value of their entry.</p>
  
  <p>It works great in excel.   But having some troubles in the syntax for SQL.   </p>
  
  <p>I know that first I need to sort the file so that everything comes through in the correct order, got that.  But from that point on I am clueless.</p>
  
  <p>If a more in depth explanation is needed for my excel code I can do that, if it helps.</p>