|
|
| Do you know where your variables are? | |
| PerlMonks |
Re^6: SQL Database Table to Perl Scriptby Anonymous Monk |
| on Oct 05, 2012 at 20:13 UTC ( #997539=note: print w/ replies, xml ) | Need Help?? |
|
1) Query data from transaction table and calculate the total balance in each account Select columns from your table, group by "accnum". When "type" = 'credit', then add "amount"; when "type" = 'debit', subtract "amount". And then display the result as a column in your resultset. 2) Query data from transaction table SELECT columns FROM transaction tableand calculate total amount sum(...)debited by cheque, chequeno IS NOT NULLdd ddno IS NOT NULLand by cash chequeno IS NULL AND ddno IS NULLfor each account. GROUP BY accnumFor the rest, why not look here? And there.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||