Friday, February 9, 2018

RANGE UNBOUNDED

select
gwid,
spidm,
ctrm,
ctrm_yr,
ctrm_sort,
gamaj11,
gacol,
ehrs_cum,
gpa_hrs gpa_hrs1,
nod_gpahrs GPA_HRS2,
to_char(avg(GPA),'fm99990.00') GPA,
to_char(nvl(avg(pts),0),'fm999999990.00') pts,
to_char(avg(GPA2),'fm999990.00') GPA2,
shrttrm_astd_code_end_of_term,
to_char(SUM(ehrs_cum) OVER (ORDER BY ctrm_yr,ctrm_sort RANGE UNBOUNDED PRECEDING),'fm99990.00') ehrs_cum_ext,
to_char(SUM(gpa_hrs) OVER (ORDER BY ctrm_yr,ctrm_sort RANGE UNBOUNDED PRECEDING),'fm99990.00') gpa_hrs_ext,
to_char(SUM(avg(GPA)) OVER (ORDER BY ctrm_yr,ctrm_sort RANGE UNBOUNDED PRECEDING),'fm99990.00') gpa_ext,
to_char(SUM(avg(pts)) OVER (ORDER BY ctrm_yr,ctrm_sort RANGE UNBOUNDED PRECEDING),'fm99990.00') pts_ext,
shrttrm_astd_code_dl
from (
select
 distinct gwid,
spidm,
ctrm,
ctrm_yr,
ctrm_sort,
gamaj11,
gacol,
to_char(round(ehrs_cum),'fm999990.00') ehrs_cum,
to_char(round(gpa_hrs),'fm999990.00') gpa_hrs,
to_char(gpa,'fm999990.00') gpa,
pts pts,
to_char(round(nod_gpahrs),'fm999990.00')  nod_gpahrs,
tqpts,
to_char(GPA2,'fm999990.00')  GPA2,
shrttrm_astd_code_end_of_term,
shrttrm_astd_code_dl

from
(
select
gzrbipr_char_3 gwid,
gzrbipr_char_4 spidm,
gzrbipr_char_77 ctrm ,
SUBSTR(gzrbipr_char_77,instr(gzrbipr_char_77,' ',-1,1)+1) ctrm_yr,
(case when SUBSTR(gzrbipr_char_77,1,instr(gzrbipr_char_77,' ',-1,1)-1)='Spring' then 'a'
when SUBSTR(gzrbipr_char_77,1,instr(gzrbipr_char_77,' ',-1,1)-1)='Summer' then 'b'
when SUBSTR(gzrbipr_char_77,1,instr(gzrbipr_char_77,' ',-1,1)-1)='Fall' then 'c'
else null
end ) ctrm_sort,
gzrbipr_char_31 gacol ,
gzrbipr_char_36 gamaj11 ,
gzrbipr_char_88 ehrs_cum ,
nvl(gzrbipr_char_91,0)  gpa_hrs ,
nvl(gzrbipr_char_165,0) gpa ,
( case when gzrbipr_char_167='Y' THEN (case when gzrbipr_char_69 < '199303' then nvl(gzrbipr_char_166,0)  end)
  else nvl(gzrbipr_char_166,0)
  end)  pts,
nvl(gzrbipr_char_91,0) nod_gpahrs,
nvl(gzrbipr_char_166,0) tqpts
,
(case when gzrbipr_char_91>0 then gzrbipr_char_166/gzrbipr_char_91 end)GPA2,
    gzrbipr_char_82 shrttrm_astd_code_end_of_term,
  gzrbipr_char_83 shrttrm_astd_code_dl
from gzrbipr
)

group by
gwid,
spidm,
ctrm,
ctrm_yr,
ctrm_sort,
gamaj11,
gacol,
ehrs_cum,
gpa_hrs,
gpa,
pts,
nod_gpahrs,
tqpts,
shrttrm_astd_code_end_of_term,
shrttrm_astd_code_dl
,
GPA2
)
where gwid='G14759230'
Group by
gwid,
spidm,
ctrm,
ctrm_yr,
ctrm_sort,
gamaj11,
gacol,
ehrs_cum,
gpa_hrs ,
nod_gpahrs,
shrttrm_astd_code_end_of_term,
shrttrm_astd_code_dl
order by ctrm_yr,ctrm_sort

1 comment:

  1. You should see how my pal Wesley Virgin's adventure starts in this shocking and controversial video.

    As a matter of fact, Wesley was in the army-and soon after leaving-he unveiled hidden, "MIND CONTROL" tactics that the CIA and others used to get everything they want.

    As it turns out, these are the exact same tactics tons of famous people (especially those who "became famous out of nothing") and elite business people used to become rich and successful.

    You probably know that you utilize only 10% of your brain.

    That's really because most of your brain's power is UNCONSCIOUS.

    Perhaps that expression has even occurred INSIDE your own mind... as it did in my good friend Wesley Virgin's mind 7 years back, while driving an unlicensed, beat-up trash bucket of a vehicle with a suspended license and with $3.20 on his debit card.

    "I'm so fed up with going through life check to check! When will I finally succeed?"

    You took part in those types of conversations, ain't it right?

    Your very own success story is going to start. You just need to take a leap of faith in YOURSELF.

    Learn How To Become A MILLIONAIRE Fast

    ReplyDelete