I have a stored procedure in which if I write the following query without a variable, all: works well
CREATE PROCEDURE `some_proc` ()
BEGIN
SELECT blabla FROM mytable ORDER BY id LIMIT 3,1
.....
but, if I use a variable as start number in LIMIT expression, I get an error:
CREATE PROCEDURE `some_proc` ()
BEGIN
DECLARE start INT;
SET start = 3;
SELECT blabla FROM mytable ORDER BY id LIMIT start,1
.....
Is there a way to use a variable in the LIMIT expression inside the stored procedure?