salix/db/routines/util/views/eventLogGrouped.sql

12 lines
308 B
MySQL
Raw Permalink Normal View History

CREATE OR REPLACE DEFINER=`root`@`localhost`
SQL SECURITY DEFINER
VIEW `util`.`eventLogGrouped`
AS SELECT max(`t`.`date`) AS `lastHappened`,
COUNT(0) AS `nErrors`,
`t`.`event` AS `event`,
`t`.`error` AS `error`
FROM `util`.`eventLog` `t`
GROUP BY `t`.`event`,
`t`.`error`
ORDER BY max(`t`.`date`) DESC