I\'m looking for an efficient way to collate all blog posts into a menu of the following format:
2012
From your question, I understand you're trying to come up with a query to group a number of elements by month and year. The following should do the trick:
SELECT
YEAR(dateField) AS YEAR,
MONTH(dateField) AS MONTH,
COUNT(*) AS TOTAL
FROM table
GROUP BY YEAR, MONTH
Obviously, "dateField" being the name of your datetime/timestamp column and "table" being the name of your table.
More information on the GROUP BY clause and aggregate functions (such as the COUNT(*) function used above) here.