How can I write an sql statement that returns a list of how many students
had lessons
for each of the last 12 months?
so I would expect output something like:
+--------+----------------+
| Month | No of Students |
+--------+----------------+
| Oct 08 | 12 |
| ... | ... |
| ... | ... |
| Sep 09 | 15 |
+-------------------------+
edit: relevant schema -
lessons{student_id:INT, time:DATE}
student{id:INT, person_id:INT}
Students may take any number of lessons in a given month, so I'm not interested in how many lessons were in a month but how many students took lessons in that month