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!

SQL for last 4 quarters

571706Oct 30 2008 — edited Oct 31 2008
Hello,

I was wondering if there is a good way to find Last 4 quarters (excluding the current quarter). So If today is Oct 30th 2008, it should show 2007-Q4, 2008-Q1, 2008-Q2, 2008-Q3.

I have a table whose column (Varchar2) in Oracle 8i has values in this format (YYYY-Q1) ie. 2008-Q1, 2008-Q2 and i want to get data where i find the match.

Example:

select * from mytable
where time_frame in ( list of last 4 quarters)


Thank you in advance.
This post has been answered by Solomon Yakobson on Oct 30 2008
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 28 2008
Added on Oct 30 2008
5 comments
2,708 views