I have a database of events and the date they happen on. There can be multiple events per day, but there are also days where there aren't any events. I want to get an average per day, but only count those days that have events.
My thinking is to use a combination of COUNT() and DISTINCT to count the dates that are within the search range and use that as my divisor. Is there an easier (or faster) way?