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!

using LEVEL keyword

user10403630Nov 19 2012 — edited Nov 19 2012
Hi,

I have a table like below..
CAL eff_date
A 1/1/2012
A 1/2/2012
A 1/3/2012
A 1/4/2012
A 1/5/2012
A 1/6/2012
A 1/7/2012

And now I need to somehow generate this weekly caledar for 1 year.(using sql) I tried using level.

with t as
(select level l from dual connect by level <=52),
t1 as
(SELECT c.cal,eff+l eff,perwgt,repeat,opt
FROM cal c,t

)
select * from t1 order by eff

Can anyone help me out how to add a seq no for each date. meaning all records should be added with 1 and then 2 and the 3... upto 52

Thanks..
This post has been answered by Frank Kulash on Nov 19 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 17 2012
Added on Nov 19 2012
5 comments
232 views