1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2025-04-05 00:27:25 +00:00
mailinabox/management/reporting/uidata/flagged_connections.7.sql
downtownallday 721dd1273f Add IMAP connection reporting
Fix binsizes and barwidths on timeseries charts
Fix timezone issue in timeseries scales
2021-04-08 12:53:32 -04:00

20 lines
488 B
SQL

-- pie chart for "connections by disposition"
--
-- returns a table of disposition along with it's count
SELECT disposition, sum(count) AS `count`
FROM (
SELECT disposition, count(*) AS `count`
FROM mta_connection
WHERE connect_time>=:start_date AND connect_time<:end_date
GROUP by disposition
UNION
SELECT disposition, count(*) AS `count`
FROM imap_connection
WHERE connect_time>=:start_date AND connect_time<:end_date
GROUP BY disposition
)
GROUP BY disposition