gpt4 book ai didi

mysql - 尝试创建事件时出现问题

转载 作者:行者123 更新时间:2023-11-29 20:10:50 26 4
gpt4 key购买 nike

我正在尝试创建一个事件,但收到以下错误:

enter image description here

我的查询:

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

最佳答案

问题可能出在您的 SUM 上。我认为它们应该看起来像这样: SUM(IF(di.connectedOr = 'true', 1, 0))

关于mysql - 尝试创建事件时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40139612/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com