|
-
This is a really crude first iteration... fixed range
select school_cd,name,start_year,start_year+1
from school
where start_year <= to_number(to_char(sysdate,'YYYY'))-3
and end_year > to_number(to_char(sysdate,'YYYY'))-3
union all
select school_cd,name,start_year+1,start_year+2
from school
where start_year <= to_number(to_char(sysdate,'YYYY'))-2
and end_year > to_number(to_char(sysdate,'YYYY'))-2
union all
select school_cd,name,start_year+2,start_year+3
from school
where start_year <= to_number(to_char(sysdate,'YYYY'))-1
and end_year > to_number(to_char(sysdate,'YYYY'))-1
order by 1,3,4
Last edited by KenEwald; 08-25-2003 at 05:17 PM.
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
|
Click Here to Expand Forum to Full Width
|