title: SQL Query to Log total number of matching rows into another table by date
body: <p>I am trying to create a SQL query that can log to another dedicated table the number of total rows in another table. Once row count is done that number is copied to the dedicated table under the same name as the table it is being retrieved from.</p>
  
  <pre><code>Dedicated Table Structure:
  
  Table_Name                 Date:              Total_Count:
  Table_Demo                 22/05/13           35000
  Table_Demo_2               22/05/13           9000
  Another_Sample_Table       18/05/13           6900
  </code></pre>
  
  <p>So from the above a sql query was run for 'Table_Demo' for all rows on the 22/05/13 the total number returned was 35000 which was then stored under the Total_Count column just be able to update as well as create a new row if one does not exist for example Table_Demo_2 has already an entry for the 22/05/13 of 9000 but on the same day another SQL query is run and 6000 rows are returned this then updates Table_Demo_2 Total_Count from 9000 to 15000.</p>
  
  <p>My database is Mysql.</p>
  
  <p>Thanks for your assistance with this.</p>