Created
June 28, 2017 02:49
-
-
Save tomca32/172b88629b8e2e1381e1c4acef8327fe to your computer and use it in GitHub Desktop.
Month-assessment query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select to_char(date_trunc('month', l.date), 'YYYY-MM') as month, count(distinct(l.id, g.student_id)) as assessments | |
from lessons as l | |
inner join grades as g | |
on l.id = g.lesson_id | |
group by month | |
order by month; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment