Something like this perhaps?
Note: Code was not tested, sorry, have real work on my plateCode:update loans l set l.status = 'PAID' where l.loan_mount <= ( select sum(p.payment_amount) from payments p where l.empid = p.empid and l.loan_type = p.loan_type group by p.empid,p.loan_type ) ;![]()




Reply With Quote