I have two tables Loan and Member. Now in Loan i have column totalamount and in Member i have column as membertype and in Loan i have various loan according to membertype. Now I want to use a SUM function to calculate totalamount according to the memtype.
I tried something as follows :
select sum(totalamount) from loan,member where member.mem_type='Regular'