/*
 * Demonstrate MySQL function returning a variable
 */

SET @min_score = 1200;

DROP FUNCTION IF EXISTS return_it;

DELIMITER $$

CREATE FUNCTION return_it()
  RETURNS INTEGER
  DETERMINISTIC
  BEGIN
    return @min_score;
  END $$

DELIMITER ;

/* just return the value */
SELECT @min_score;
/* use the returned value */
SELECT * FROM Player2 WHERE HS >= return_it();

