title: No return found in function
body: <p>I have browsed around and other solutions don't seem to be working for me here. I keep getting a 'No return found for functon' error when trying to create this function in MySQL. Any idea why?</p>
  
  <pre><code>CREATE FUNCTION `mydb`.`myfunction`(Name varchar(20))
  RETURNS int
  LANGUAGE SQL
  NOT DETERMINISTIC
  SELECT SUM(Transaction.Bought) INTO @Qty FROM Transaction WHERE Transaction.Name = Name;
  RETURN @Qty
  </code></pre>