0

Is there any way to write this query from oracle rdbms in postgres? What I care about it to have track of the iterations made(level) and to be able to iterate a particular number of times(10).

SELECT LEVEL 
FROM dual
CONNECT BY LEVEL <= 10;

1 Answer 1

2

You can use generate_series()

select *
from generate_series(1,10) as t(nr)
Sign up to request clarification or add additional context in comments.

3 Comments

Awesome, as soon as I will be able to accept this answer I will do that.
Is there any way to pass this function dynamic value. For example subquery output?
@Z.Szymon: yes, that's possible. It's a regular (set returning) function.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.