title: MySql: assign variable a random number using RAND(seed)
body: <p>I am trying to do something I think is pretty simple, just use RAND to create a random number between 0-1, and assign it to a decimal variable.
  BUT every time I run my code in MySQL it gives back ZERO!</p>
  
  <p>See code below:</p>
  
  <pre><code>DELIMITER $$
  CREATE DEFINER=`root`@`localhost` FUNCTION `myfuncRand`() RETURNS decimal(10,5)
      DETERMINISTIC
  BEGIN
  DECLARE dist decimal;
  set dist = RAND(145);
  RETURN dist;
  END$$
  
  
  select myfuncRand();
  </code></pre>