I want to randomly pick a data tuple from a literal table to fill in another table, and randomize the row to pick each time. With the below query, I fill all rows with the same data, so I think the random row is picked once and used everywhere.
So how can I get a random row for each row to update in the Oracle database?
update HISTORY h
set (ORGANIZATION_ID, COMPANY_ID) = (
select org_id, company_id from (
select * from (
select '3.11' as org_id, '11111111' as company_id from dual union
select '3.22.3' as org_id, '22222222' as company_id from dual union
...
select '3.44.5' as org_id, '33333333' as company_id from dual
) order by DBMS_RANDOM.RANDOM
) where rownum = 1
) where CODE = '1234567'; -- originally all were 3.88.4 and 88000004. 20707 rows