title: Counter for each table row which restarts on date change Mysql
body: <p>I have the following mysql query that returns at counter as well as the results from the table, however I want the counter to restart whenever the date changes, can anyone assist in shedding some light in assisting, much appreciated</p>
  
  <pre><code>SELECT
  @n := @n + 1 RowNumber,a.run_date
  
  FROM (SELECT @n:=0 initvars),run_table a
  </code></pre>