日期:2014-05-18  浏览次数:20548 次

请问怎么筛选这种条件的数据。
select b.LoanBackBlank,a.ContractNm,SUM(a.RepayAmount)-SUM(a.receivableAmount) repaymoney,b.CustomNm,b.LoanBkAccount,b.LoanBkBank,b.LoanBkBankID,b.CustomType,b.LoanBackBlank 
 from InterestReceive a,OPSInf b where a.ContractNm=b.LoanNm 
 group by b.LoanBackBlank,a.ContractNm,b.CustomNm,b.LoanBkAccount,b.LoanBkBank,b.LoanBkBankID,b.CustomType 

SQL提取出来的数据,是包含repaymoney=0的数据,怎么才能让他大于等于0.01的数据才筛选出来。

------解决方案--------------------
select b.LoanBackBlank,a.ContractNm,SUM(a.RepayAmount)-SUM(a.receivableAmount) repaymoney,b.CustomNm,b.LoanBkAccount,b.LoanBkBank,b.LoanBkBankID,b.CustomType,b.LoanBackBlank
 from InterestReceive a,OPSInf b where a.ContractNm=b.LoanNm
 group by b.LoanBackBlank,a.ContractNm,b.CustomNm,b.LoanBkAccount,b.LoanBkBank,b.LoanBkBankID,b.CustomType
having SUM(a.RepayAmount)-SUM(a.receivableAmount)>=0.01
------解决方案--------------------
SQL code
having SUM(a.RepayAmount)-SUM(a.receivableAmount)>=0.01