-
Junior Member
Query to go back to one year
Hi all,
Our requirement, needs to display
200708
200707
200706
200705
200704
200703
200702
200701
200612
200611
200610
200609
200608
200607
Starting from August is example only.
we need to develop based on system date.
From current month to we have to go back to one year.
We prepared the query as follows.
select to_char(sysdate,'yyyy')||to_char(a.b) b from (select rownum b from dual connect by rownum between 1 and 12) a
It may give some idea.
Plz try to send ASAP.
Thanks,
Suvarna
-
Expert Member
Re: Query to go back to one year
Try this select to_char ( add_months (trunc(sysdate,'y'),rownum-1),'yyyymm') yyyymm from cat where rownum <= 12;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules