Reputation: 23
I'm trying to create a series of numbers for multiple samples using a distribution plot. I want to have numbers .01, .02, .03... etc. in a column by itself, just creating a random number.
I have tried randbetween(0,1) but I cannot have it run a specified number of times and it is also not in sequence. I also tried rand() but that didn't work either.
The output should be something like this:
Upvotes: 0
Views: 1211
Reputation: 1269823
Use generate_array()
to generate a series of numbers. Then divide:
select cast(n / 1000000 as numeric)
from unnest(generate_array(1, 10)) n
Upvotes: 2