Is there any simple method to get a series:
0.01 0.02 0.03 ... ... ... 0.97 0.98 0.99
like series generation from 1 to 99
SELECT * FROM generate_series(1, 99)
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.Sign up to join this community
Yes, it is quite easy:
SELECT a.n FROM generate_series(0.01, 0.99,0.01) as a(n);
Working demo: http://sqlfiddle.com/#!17/9eecb/80581
0.01 - start of series 0.99 - end of series
0.01 - increment value from series start to series end
Another easy way:
The only trickiness here is the need to cast the integer to a float so you don't get integer division.
also work but for some reason display with lots of trailing zeros.