我编写了以下SQL查询:
CREATE PROCEDURE query_05_b(OUT rez VARCHAR(200))
BEGIN
rez := "SELECT numean FROM angajati WHERE idan IN (SELECT idan FROM certificare);";
END
当我尝试运行它时,收到以下错误消息:
MySQL说:文档 #1064 - 您的SQL语法有错误;查看与您的MariaDB服务器版本对应的手册,以便在':='附近使用正确的语法SELECT SELECTAN FROM angajati WHERE idan IN(SELECT idan FROM certificare);“'at line 3
你能帮我理解我写的查询有什么问题,因为我真的不明白错误在哪里。
谢谢!
答案 0 :(得分:2)
我相信你正在尝试返回SQL字符串,然后
你的语法错误
rez := "SELECT numean FROM angajati WHERE idan IN (SELECT idan FROM certificare);";
代替
SET rez = "SELECT numean FROM angajati WHERE idan IN (SELECT idan FROM certificare);";