SELECT COUNT(*) AS num_posts, school_id, user_id, integration_source, content_type, DATE(created_timestamp) AS range_timestamp, (24*60*60) AS range_duration
FROM posts
WHERE created_timestamp >= '2010-01-01 00:00:00'
AND created_timestamp < '2020-04-01 00:00:00'
AND valid=1
GROUP BY school_id, user_id, integration_source, content_type, DATE(created_timestamp)