[英]Error #1064 in SQL query
I have written the following SQL query: 我编写了以下SQL查询:
CREATE PROCEDURE query_05_b(OUT rez VARCHAR(200))
BEGIN
rez := "SELECT numean FROM angajati WHERE idan IN (SELECT idan FROM certificare);";
END
When I try to run it, I get the following error message: 当我尝试运行它时,出现以下错误消息:
MySQL said: Documentation #1064 - You have an error in your SQL syntax; MySQL说:文档#1064-您的SQL语法错误; check the manual that corresponds to your MariaDB server version for the right syntax to use near ':= "SELECT numean FROM angajati WHERE idan IN (SELECT idan FROM certificare);"' at line 3 在第3行上,检查与您的MariaDB服务器版本相对应的手册,以在':=“ SELECT numean FROM angajati WHERE idan IN(SELECT idan FROM certificare);”中使用正确的语法。
Can you help me understand what is the problem with the query that I have written because I really don't understand where is the mistake. 您能帮助我理解我编写的查询的问题是什么,因为我真的不知道错误在哪里。
Thank you! 谢谢!
I believe you are trying to return SQL string, then 我相信您正在尝试返回SQL字符串,然后
You have wrong syntax 您的语法错误
rez := "SELECT numean FROM angajati WHERE idan IN (SELECT idan FROM certificare);";
instead 代替
SET rez = "SELECT numean FROM angajati WHERE idan IN (SELECT idan FROM certificare);";
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.