谁能告诉我为什么我在 MySql 中收到此错误:错误代码:1064。您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在第 1 行的“NULL”附近使用正确的语法
这是我的代码:
CREATE PROCEDURE `msgBoardGetComments2`(
IN _StoryID INT,
IN _RowNum INT
)
BEGIN
DECLARE _sql VARCHAR(1000);
SET _sql := CONCAT('SELECT c.CommentText, c.CommentDate, a.UserName
FROM comments c
LEFT JOIN accounts a
ON c.UserID = a.UserID
LEFT JOIN stories s
ON c.StoryID = s.StoryID
WHERE c.StoryID = ',_StoryID, '
ORDER BY c.CommentDate DESC
LIMIT 10
OFFSET ', _RowNum);
PREPARE stmt1 FROM @_sql;
EXECUTE stmt1;
结尾