-
Date Spread across 2 years? - How to ??
Hi,
I need to populate a date column for a demo. Table has 100K rows. New column is 'LAST_PURCHASE_DATE'.
I need to update the column with date from sysdate to sysdate - 2years.
I'll be looking to code this earlier this morning, but would appreciate any pearls of wisdom.
Thanks.
Horace.
-
How about
UPDATE my_table
SET dateColumn = SYSDATE - MOD(ROWNUM, 730);
-
Thanks for the input DaPi.
I must be getting better at this coding lark, 'cos that's exactly what I came up with.
Ta.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|