Hello All,
I need to change this portion (having sum(sfrstcr_credit_hr)>=12) of my script to give the following output -
having sum(sfrstcr_credit_hr)>=12 and >6
Basically, I need an output with credit less than 12 but more than 6. It doesn't work as above.
Here is the complete script.
select distinct
sfrstcr_camp_code campus,
spriden_id ID,
substr(spriden_last_name,1,15) LNAME,
substr(spriden_first_name,1,15) FNAME,
sgbstdn_majr_code_1 MAJOR,
stvmajr_desc DESCRIPTION,
sum(sfrstcr_credit_hr) CREDITS
from
saturn.spriden,
saturn.sgbstdn,
saturn.stvmajr,
saturn.sfrstcr
where spriden_change_ind is null
and sfrstcr_term_code = &term
and spriden_pidm = sgbstdn_pidm
and stvmajr_code = sgbstdn_program_1
and sfrstcr_pidm = spriden_pidm
and (sfrstcr_rsts_code like 'R%' or sfrstcr_rsts_code like 'K%')
and sgbstdn_pidm = spriden_pidm
and sfrstcr_levl_code in ('50')
and sgbstdn_term_code_eff =
(select max(b.sgbstdn_term_code_eff)
from saturn.sgbstdn b
where b.sgbstdn_pidm = spriden_pidm
and b.sgbstdn_term_code_eff<= sfrstcr_term_code)
group by
sfrstcr_camp_code,
spriden_id,
substr(spriden_last_name,1,15),
substr(spriden_first_name,1,15),
sgbstdn_majr_code_1,
stvmajr_desc
having sum(sfrstcr_credit_hr)>=12
/
exit;
The red highlighted area is all I need changed.
Thanks