All Forums Analytics
mad_about_coffee 5 posts Joined 06/09
05 Jun 2009
Random values

Hi,


I hope somebody can help me with my task. We are currently in the part of transitioning from oracle to teradata, and the problem that I currently have and which I really cannot identify is on how to produce random values in teradata the same way it was produced in oracle. Confusing but I have copied the results that I wanted to produce below:


ORACLE code:
dbms_random.value(0,1) as random_nbr

TERADATA code:
random(0,1) as random_nbr


RESULTS:

--------ORACLE--------vs-------TERADATA
Row1: 0.546476429------------------1
Row2: 0.095457194------------------0
Row3: 0.254218001------------------1
Row4: 0.054972349------------------0
Row5: 0.978196729------------------1



Thank you sooo much in advance, hoping that I can get the same result as the oracle's!

Jim Chapman 260 posts Joined 09/04
05 Jun 2009

select cast(random(0,999999999) as float)/1000000000 (format '9.999999999') as random_nbr;


random_nbr
-----------
0.674948197

mad_about_coffee 5 posts Joined 06/09
08 Jun 2009

woah!!! thank you sooo much!

You must sign in to leave a comment.