mysql stored procedure: using declared vars in a limit statement returns an error

前端 未结 1 1256
伪装坚强ぢ
伪装坚强ぢ 2021-01-07 08:58

I have the following code:

delimiter ;

DROP PROCEDURE IF EXISTS ufk_test;
delimiter //
CREATE PROCEDURE ufk_test(IN highscoreChallengeId INT UNSIGNED)
BEGIN         


        
相关标签:
1条回答
  • 2021-01-07 09:14

    i use something like:

    SET @s = CONCAT('SELECT * FROM table limit  ', vLoopOrder ', ', vLoopLimit); 
    PREPARE stmt1 FROM @s; 
    EXECUTE stmt1; 
    DEALLOCATE PREPARE stmt1;
    
    0 讨论(0)
提交回复
热议问题