note
Generoso
<p> Maybe this SQL will help. </p>
<code> SELECT AccNum, max(date), Type, sum(Amount) FROM transaction GROUP BY AccNum, Type
union
SELECT AccNum, max(date),'Balance', sum(if (type='Debit',-1*Amount,Amount)) FROM transaction GROUP BY AccNum;
SELECT * FROM transaction t where chequeno is not null or ddno is not null;
</code>
<p> And this has little to do with perl this is an datbase question </p>
997371
997411