I'm trying to write a function that takes a minimum and a maximum input and returns a double.
Inputs:
high (integer)
low (integer)
Output:
val (double)
My SQL code is:
CREATE OR REPLACE FUNCTION random_between(low INT ,high INT)
RETURNS DOUBLE AS
BEGIN
RETURN floor(random()* (high-low + 1) + low);
END;
The error:
ERROR: syntax error at or near "BEGIN"