oracle generate a random date using julian dates
SELECT TO_CHAR(TO_DATE('2006-06-06', 'YYYY-MM-DD'), 'J') FROM DUAL;
--> 2453893
SELECT TO_CHAR(TO_DATE('2007-10-01', 'YYYY-MM-DD'), 'J') FROM DUAL;
--> 2454375
SELECT TO_DATE(TRUNC(DBMS_RANDOM.VALUE(2453893, 2454375)), 'J') FROM DUAL;
--> 19/SEP/06
No comments:
Post a Comment