tags:

views:

41

answers:

1

I have a table containing the following details:

date_info   info
2009-06-23  1
2009-06-24  2
2009-06-25  20
2009-06-26  14
2009-06-27  17
2009-06-28  5
2009-06-29  10
2009-06-30  2
etc.

I would like to group the info coloumn by occurrences per week and month, like so:

2009-06-01_2009-06-07 XXX
2009-06-08_2009-06-14 XXX

Grouping by a calendaric week would be ideal.

Ideas?

+2  A: 

By the time I wrote the question, I figured out the solution: using WEEKOFYEAR:

SELECT WEEKOFYEAR(date_info) as MaWeek, SUM(info) from table1 GROUP BY MaWeek
Am
I really don't care for people gaming the system to get the `Self-Learner` badge: http://stackoverflow.com/badges/14/self-learner
OMG Ponies
i don't care about the badges, i really figured it out when i finished writing the question.
Am