title: SQL query to group by month part of timestamp
body: <p>I'm really bad at SQL queries but I'm learning so please forgive this question.</p>
  
  <p>Here is my current query:</p>
  
  <pre><code>SELECT TIMESTAMP, SUM( electricity ) AS electricity,  `siteID` 
  FROM table
  WHERE (
  MONTH(  `TimeStamp` ) =10)
  GROUP BY siteID
  </code></pre>
  
  <p>My table looks like:</p>
  
  <pre><code>#########################################
  # Id # SiteID # TimeStamp  # Elecricity #
  # 0  # 100    # 10/08/2012 # 50         #
  # 1  # 98     # 10/08/2012 # 32         #
  # 2  # 100    # 10/09/2012 # 96         #
  # 3  # 94     # 10/09/2012 # 25         #
  # 4  # 100    # 10/10/2012 # 100        #
  # 5  # 100    # 10/11/2012 # 55         #
  #########################################
  </code></pre>
  
  <p>What I am trying to do is to sum up all of the days of each month of each site, so that I will have one answer per site and month. So in this example the query should return the sum of the electricity values for siteID 100 because they're all in month 10, the same for siteID 98 and 94.</p>
  
  <p>Thanks</p>