Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

insert random values in rows postgres

CREATE OR REPLACE FUNCTION random_between(low INT ,high INT) 
   RETURNS INT AS
$$
BEGIN
   RETURN floor(random()* (high-low + 1) + low);
END;
$$ language 'plpgsql' STRICT;
Code language: SQL (Structured Query Language) (sql)
Source by www.postgresqltutorial.com #
 
PREVIOUS NEXT
Tagged: #insert #random #values #rows #postgres
ADD COMMENT
Topic
Name
1+6 =