57,062
社区成员
发帖
与我相关
我的任务
分享CREATE PROCEDURE so(IN mov char(255),IN p1 int,IN p2 int)
BEGIN
SET @sql = CONCAT('SELECT * FROM filedata where title like (%',mov,'%) order by dateandtime desc LIMIT ',p1,',',p2,'');
PREPARE sqlstmt FROM @sql;
EXECUTE sqlstmt;
DEALLOCATE PREPARE sqlstmt;
END$$call so('nba','1','2');,MYSQL提示出错:ERROR 1064 (42000): 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 '%nba%) order by dateandtime desc LIMIT 1,2' at line 1