This solution will give you the month name as a column of your resultset, followed by the total as required.
SELECT MONTHNAME(o_date), SUM(total)
FROM theTable
GROUP BY YEAR(o_date), MONTH(o_date)
More Related Contents:
- SELECT / GROUP BY – segments of time (10 seconds, 30 seconds, etc)
- Converting SELECT DISTINCT ON queries from Postgresql to MySQL
- Sum results of a few queries and then find top 5 in SQL
- Recreating a query using INNER JOIN? [duplicate]
- Using LIMIT within GROUP BY to get N results per group?
- Group by clause in mySQL and postgreSQL, why the error in postgreSQL?
- Create a temporary table in a SELECT statement without a separate CREATE TABLE
- Retrieving the last record in each group – MySQL
- MySQL – Selecting a Column not in Group By
- MySQL SELECT WHERE datetime matches day (and not necessarily time)
- MySQL Query – Records between Today and Last 30 Days
- Mysql query to dynamically convert rows to columns
- Ordering by specific field value first
- MySQL “Group By” and “Order By”
- INSERT INTO…SELECT for all MySQL columns
- #1139 – Got error ‘repetition-operator operand invalid’ from regexp
- SQL Query to get column values that correspond with MAX value of another column?
- Checking multiple columns for one value
- MySQL – How to search for exact word match using LIKE?
- MySQL – Fetching lowest value
- MySQL – How to select data by string length
- How to select the first row for each group in MySQL?
- MySQL GROUP BY DateTime +/- 3 seconds
- SELECT query return 1 row from each group
- SELECT INTO Variable in MySQL DECLARE causes syntax error?
- MySQL Error: #1142 – SELECT command denied to user
- MySQL Group By Hours
- MySQL cumulative sum grouped by date
- MySQL Select Multiple VALUES
- SQL query with avg and group by