Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
I need to create data series with the value from 0 to 100 with a step of 0.1 Unfortunately, function generate_series() does not work with my database. does anyone know any other way to create a series like this? Thank you in advance.
generate_series()
select version();
One way is to use recursive cte:
WITH RECURSIVE CTE(c) AS ( VALUES (0.0) UNION ALL SELECT c + 0.1 FROM cte WHERE c <= 100 ) SELECT * FROM CTE;
db<>fiddle demo
Add a comment
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
generate_series()- are you sure you are using Postgres? What doesselect version();give you?generate_series(). Please correctly identify the database you are using.