Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

sql iteration

alinuxJul 16 2008 — edited Jul 16 2008
Hi guys,

It is possible to iterate some how in one select command?

Example:

I have one dates table: date_table

and select a_data from date_table.

I want to build a new select that will execute my date_table select for a specific number of times. I will input the number of times, using a parameter:


the resulting select will be similar to:
 
for i in 1..:n loop 
select a_data + from date_table; 
end loop; 
Can I do this in one select?

joining with
(select a from (select level a  from dual connect by 1 = 1) where rownum < 3) a
will be an idea?
Thanks

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 13 2008
Added on Jul 16 2008
4 comments
2,378 views