请问在mysql中编写这个存储过程的正确方法是什么-我从phpmyadmin得到了1064错误
BEGIN
DECLARE @Correct VARCHAR(50)
SELECT @Correct = answer FROM tbl_questions WHERE id = @getid
SELECT CASE @Correct
WHEN 'OptionOne' THEN (SELECT OptionOne FROM tbl_questions WHERE id = @getid)
WHEN 'OptionTwo' THEN (SELECT OptionTwo FROM tbl_questions WHERE id = @getid)
WHEN 'OptionThree' THEN (SELECT OptionThree FROM tbl_questions WHERE id = @getid)
WHEN 'OptionFour' THEN (SELECT OptionFour FROM tbl_questions WHERE id = @getid)
END Answer
FROM tbl_questions
WHERE id = @getid;
END;
暂无答案!
目前还没有任何答案,快来回答吧!