donnatronious
asked on
I want to do something like what is on the 4th l line of query
SELECT max(D.delta) delta_max,
min(D.delta) delta_low,
round(avg(D.delta), 4) delta_avg,
count(D.delta > .5),
count(*) total
from(
SELECT C.LPMIMonthlyAmt CM, B.LPMIMonthlyAmt CM2, round((B.LPMIMonthlyAmt- C.LPMIMonthlyAmt),4) as delta
from cm.dbo.martloaninterfacede tail B join
cm2.dbo.Account_Loan C
on B.LOANACCTNUM = C.AccountNumber
where B.loanacctnum IN (SELECT A.acct
from dbo.cm_loans A
where A.acct IN (select acct
from CMvCM2LoanDetailCompare
where score & 131072 = 131072)
and A.live ='1')
)as D
min(D.delta) delta_low,
round(avg(D.delta), 4) delta_avg,
count(D.delta > .5),
count(*) total
from(
SELECT C.LPMIMonthlyAmt CM, B.LPMIMonthlyAmt CM2, round((B.LPMIMonthlyAmt- C.LPMIMonthlyAmt),4) as delta
from cm.dbo.martloaninterfacede
cm2.dbo.Account_Loan C
on B.LOANACCTNUM = C.AccountNumber
where B.loanacctnum IN (SELECT A.acct
from dbo.cm_loans A
where A.acct IN (select acct
from CMvCM2LoanDetailCompare
where score & 131072 = 131072)
and A.live ='1')
)as D
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.