Okay, first I identify the date integer for the particular date, onwards from which i need to update the random values into the dpm_dateto
column :
Query :
select to_char(to_date('15/05/2013','dd/mm/yyyy'), 'J') from dual;
Result:
2456428
Now, I try to update the dpm_dateto
column using the query below:
update t_dailypm
set dpm_dateto =
(select to_date(trunc(dbms_random.value(2456428,2456428+76)), 'J') from dual)
where dpm_loc = 'P2' and dpm_department like '%IN%';
Result:
900 rows updated.
But, the problem is that each distinct value in dpm_dateto
column is updated with the same date. I can't get my head around this. Kindly help.