I have table with columns: topic, person, published_date. I would like to create query which help me compute how many times every person wrote in specific topic in every quarter. Example:
topic person published_date
'world' JS 2016-05-05
'world' JS 2016-05-10
'nature' AR 2016-12-01
should return something like
topic person quarter how_many_times
'world' JS 2 2
'nature' AR 4 1
I'm able to group it by topic and person
select topic, person, published_date, count(*) from table group by topic, person, published_date
but how group published_date into quarters?