I have my result set as I want it, but I can't find out how to display only the first row in each group. In prod I'll be running 50 FACID at at time. I am attempting to find the lowest daily average message count from a week so I can set thresholds for alerting.
select mirth_channel, facility, DATE(received_on) as Day,
round (count(*) / 24) AS 'average'
from message
where facility in ('FACID1', 'FACID2', 'FACID3', 'FACID4', 'FACID5')
AND received_on BETWEEN '2022-05-29 00:00:00' AND '2022-06-04 23:59:59'
group by DATE(received_on), facility
order by average asc;