|
|
Archives of the TeradataForum
Message Posted: Sat, 11 Feb 2012 @ 10:18:19 GMT
Subj: | | Re: Adding intervals dynamically. |
|
From: | | Dieter Noeth |
sivaram nelluri wrote:
| I have multiple records at the same time, Ex: 100 records with same time including the milli seconds too, I am trying to stretch each of
them into separate timestamps by adding a random number of seconds or milli seconds | |
record_timestamp
+ (row_number() over(partition by record_timestamp order by record_id)
* interval '0.000001' second)
I use this approach with current_timestamp to get a specific order when inserting multiple rows in a queue table.
If you don't care about the actual order and possible duplicates you might also use random(0,999999) instead of row_number, it's less
overhead.
Dieter
| |