- Get link
- X
- Other Apps
- Get link
- X
- Other Apps
This select is easy to convert a simple function to get random numbers between two values:
CREATE OR REPLACE FUNCTION get_random_number(INTEGER, INTEGER) RETURNS INTEGER AS $$ DECLARE start_int ALIAS FOR $1; end_int ALIAS FOR $2; BEGIN RETURN trunc(random() * (end_int-start_int) + start_int); END; $$ LANGUAGE 'plpgsql' STRICT;
Comments
Post a Comment