下面的功能没有执行..我知道为什么..
DELIMITER $$
USE `vcbvb`$$
CREATE DEFINER=`dffgdfgfdgg`@`%` FUNCTION `split_string`(
stringToSplit VARCHAR(256),
SIGN VARCHAR(12),
POSITION INT
)
RETURNS VARCHAR(256);
BEGIN
RETURN REPLACE(SUBSTRING(SUBSTRING_INDEX(stringToSplit, SIGN, POSITION),LENGTH(SUBSTRING_INDEX(stringToSplit, SIGN, POSITION -1)) + 1), SIGN, '');
END$$
DELIMITER ;
请帮助我,我收到如下错误
错误: 错误代码:1064 您的SQL语法有错误;检查与MySQL服务器版本对应的手册,以便在';
附近使用正确的语法BEGIN
RETURN REPLACE(SUBSTRING(SUBSTRING_INDEX(stringToSplit,' at line 6
答案 0 :(得分:0)
DELIMITER $$
USE `vcbvb`$$
CREATE DEFINER=`dffgdfgfdgg`@`%` FUNCTION `split_string`(
stringToSplit VARCHAR(256),
SIGN VARCHAR(12),
POSITION INT
)
RETURNS VARCHAR(256);
BEGIN
RETURN REPLACE(SUBSTRING(SUBSTRING_INDEX(stringToSplit, SIGN, POSITION),LENGTH(SUBSTRING_INDEX(stringToSplit, SIGN, POSITION -1)) + 1), SIGN, ``);
END$$
DELIMITER ;
我认为你必须将引号从''改为``