SELECT * FROM metrics WHERE metric_type = "ojs::counter" and assoc_type=1048585 and monts like '2019%'; select sum(metric) from metrics where metric_type = "ojs::counter" and assoc_type=521 and month like '2019%'; "SELECT , SUM(metric) AS metric FROM metrics WHERE assoc_type='515' AND submission_id IS NOT NULL AND month IS NOT NULL GROUP BY submis select sum(metric) from metrics where submission_id=10859 and metric_type = "ojs::counter"; select sum(metric) from metrics where submission_id=10859 and metric_type = "ojs::counter" and assoc_type=1048585 SELECT submission_id, SUM(metric) AS metric FROM metrics WHERE assoc_type='1048585' and metric_type='ojs::counter' AND submission_id IS NOT NULL AND month IS NOT NULL GROUP BY submission_id ORDER BY metric DESC LIMIT 5