Can't you move the subquery in the FROM
section? Like this?
select *
from
(select *, ascii(substring(CREDIT_Grade,1,1)) + cast(substring(CREDIT_Grade,2,1) as unsigned) * .2 as CREDIT_Grade_num
from loanstats
where Loan_duration = 36) L,
(select avg(Interest_Rate) avg_rate from L_COPY_HERE) iRateAvg
group by loan_ID
having
Interest_Rate > iRateAvg.avg_rate