mysql- 错误代码: 1064 You have an error in your SQL syntax;

php中文网
发布: 2016-06-06 09:39:06
原创
3213人浏览过

mysqlcursorsql

求高手指点 语法哪里有问题啊

DELIMITER $$

CREATE
/*[DEFINER = { user | CURRENT_USER }]*/
PROCEDURE x_similarity.CovarianceEngine()
/*LANGUAGE SQL
| [NOT] DETERMINISTIC
| { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }
| SQL SECURITY { DEFINER | INVOKER }
| COMMENT 'string'*/
BEGIN
/* 定义变量一 /
DECLARE done, done2 INT DEFAULT 0;
DECLARE stockNo_a VARCHAR(6);
DECLARE coefficient DOUBLE(16,14);
/
定义光标 */

DECLARE _Cur CURSOR FOR

SELECT DISTINCT stock_no FROM history_day;

Natural Language Playlist
Natural Language Playlist

探索语言和音乐之间丰富而复杂的关系,并使用 Transformer 语言模型构建播放列表。

Natural Language Playlist 67
查看详情 Natural Language Playlist
<code>DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;#错误定义,标记循环结束  /* 打开光标 */  OPEN _Cur;       /* 循环执行 */      REPEAT          FETCH _Cur INTO stockNo_a;          IF NOT done THEN              BEGIN                /* 定义变量一 */                  DECLARE stockNo_b VARCHAR(6);                /* 定义光标 */                 DECLARE _CurInner CURSOR FOR                      SELECT DISTINCT stock_no FROM history_day;                OPEN _CurInner;                    REPEAT                    FETCH _CurInner INTO stockNo_b;                      IF NOT done2 THEN                        SELECT                            (                                AVG(a. CLOSE * b. CLOSE) - AVG(a. CLOSE) * AVG(b. CLOSE)                            ) / SQRT(                                (                                    AVG(a. CLOSE * a. CLOSE) - AVG(a. CLOSE) * AVG(a. CLOSE)                                ) * (                                    AVG(b. CLOSE * b. CLOSE) - AVG(b. CLOSE) * AVG(b. CLOSE)                                )                            ) INTO coefficient                        FROM                            history_day a,                            history_day b                        WHERE                            a.date = b.date                        AND a.date >= '2015-08-05'                        AND a.date <= '2015-08-11'                        AND a.stock_no = stockNo_a                        AND b.stock_no = stockNo_b;                        IF coefficient > 0.5 OR coefficient < -0.5 THEN                            INSERT INTO correlationanalysis (stock_no_f, stock_no_r, coefficient) VALUES(stockNo_a, stockNo_b, coefficient);                            COMMIT;                        END IF;                      END IF;                    UNTIL done2 END REPEAT;                    CLOSE _CurInner;                SET done2 = 0;            END        END IF;    UNTIL done END REPEAT;CLOSE _Cur;END$$</code>
登录后复制

DELIMITER ;

错误代码: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END IF;
UNTIL done END REPEAT;
CLOSE _Cur;
END' at line 65

错误代码修复工具(综合错误类型修复工具)
错误代码修复工具(综合错误类型修复工具)

综合错误类型修复工具是一款跨平台全能修复工具,主要解决各种错误代码因为运行时错误,未指定错误,应用程序错误等导致的系统奔溃,软件无法运行、安装、启动和使用等问题。有需要的小伙伴快来下载使用吧!

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号