I\'m really bad at SQL queries but I\'m learning so please forgive this question.
Here is my current query:
SELECT TIMESTAMP, SUM( electricity ) AS e
SELECT month('TIMESTAMP'), SUM( electricity ) AS electricity, `siteID`
FROM table
WHERE (
MONTH( `TimeStamp` ) =10)
GROUP BY siteID, month('TIMESTAMP')
This will work. One thing that you have to think about is that month is not unique. Oct, 2012, in this case, is the same as Oct 2013. You might want to add another column for year.