-- Collection of code snippets by Arne Vajhøj 
-- posted to eksperten.dk, usenet and other places (2002-now) 
DELIMITER //
CREATE PROCEDURE limsel(_n INTEGER)
BEGIN
   -- SELECT * FROM t1 ORDER BY f2 LIMIT _n;
   SELECT * FROM t1 ORDER BY f2 LIMIT 2;
END//
DELIMITER ;

CALL limsel(2);

DROP PROCEDURE limsel;
