I'm trying to create an event but I get the error below:
And my query:
CREATE EVENT insert_count
ON SCHEDULE
EVERY 50 SECOND
COMMENT 'bla bla bla bla bla bla.'
DO BEGIN
INSERT INTO teste (nome, conectado, desconectado)
SELECT parceiro.nomeP AS 'Parceiro',
SUM(di.connectedOr = 'true') AS 'ClientesConectados',
SUM(di.connectedOr = 'false') AS 'ClientesDesconectados'
FROM vpn AS di
JOIN parceiro
ON parceiro.codParceiro = di.idpartner
WHERE di.comName REGEXP 'skytef-'
GROUP BY di.idpartner
END