How can i insert data randomly from another table?
TBL_A
-----
ID
NAME
TBL_A has several records (lets say 10). I want to use the "ID" from this table and insert into another table along with other data. Any ideas? Thank!
DECLARE
BEGIN
FOR i IN 1..200 LOOP
INSERT into TBL_B values (i, (select a random ID from TBL_A));
END LOOP;
END;
/
TBL_A
-----
ID
NAME
TBL_A has several records (lets say 10). I want to use the "ID" from this table and insert into another table along with other data. Any ideas? Thank!
DECLARE
BEGIN
FOR i IN 1..200 LOOP
INSERT into TBL_B values (i, (select a random ID from TBL_A));
END LOOP;
END;
/