gpt4 book ai didi

mysql - 缺少右括号

转载 作者:行者123 更新时间:2023-11-30 22:12:46 24 4
gpt4 key购买 nike

我正在将此存储过程从 mssql 移植到 mysql,并收到一条错误消息,指出我缺少右括号,我似乎找不到原因。

CREATE PROCEDURE get_oids (IN sys_info VARCHAR(255))
BEGIN
SELECT oids.id, oids.attribute, oids.description_oid, oids.mib_name, oids.classifier
FROM oids
INNER JOIN mib_mappings
ON mib_mappings.name = oids.mib_name
WHERE ((sys_info LIKE '%' + mib_mappings.model + '%' AND sys_info LIKE '%' + mib_mappings.vendor + '%') OR mib_mappings.model = 'ALL')
AND oids.nodeType = 'CHILD' AND oids.descriptionOID is not null
GROUP BY oids.id, oids.attribute, oids.description_oid, oids.mib_name, o.classifier
END

最佳答案

你能检查一下吗,我认为问题出在 like 和 group by 末尾缺少的分号:

CREATE PROCEDURE get_oids (IN sys_info VARCHAR(255))
BEGIN
SELECT oids.id,
oids.attribute,
oids.description_oid,
oids.mib_name,
oids.classifier
FROM oids
INNER JOIN mib_mappings ON mib_mappings.name = oids.mib_name
WHERE ((sys_info LIKE CONCAT('%',mib_mappings.model,'%')
AND sys_info LIKE CONCAT('%',mib_mappings.vendor,'%')
OR mib_mappings.model = 'ALL')
AND oids.nodeType = 'CHILD'
AND oids.descriptionOID IS NOT NULL
GROUP BY oids.id, oids.attribute, oids.description_oid, oids.mib_name, o.classifier;
END

关于mysql - 缺少右括号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39516298/

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