I want to count a bunch of entries past a date. However, I also want to have results that say 0. But the current query drops all 0 results as soon as i add the filter by date clause. Any ideas how to get those 0 entries?
select distinct (e.customer_id), count(m.id) as msgs from eng_msgs e
join messages m on e.customer_id = m.customer_id
where e.customer_id = m.customer_id
and m.created_at > e.created_at -- this line removes 0 results
group by e.customer_id